Magento get simple products from configurable product

This is how you can get all simple products linked from a configurable product

$configurableProduct = Mage::getModel('catalog/product')->load(1); 
$childProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null,$configurableProduct);   
foreach($childProducts as $child) {
    echo $child->getId();

If you only need ids of the child product, you can do this

$childProductsId = Mage::getModel('catalog/product_type_configurable')->getChildrenIds(1);

Magento get configurable product from simple product

If you need to get the configurable product from a simple one, you can do this

$simpleProductId = 666;
$parentIds = Mage::getResourceSingleton('catalog/product_type_configurable')
$configurableProduct = Mage::getModel('catalog/product')->load($parentIds[0]);
echo $configurableProduct->getId();