Thanks to @marius. I got a answer from this linkthis link.
You can assign simple product to configurable by following code
Mage::getResourceSingleton('catalog/product_type_configurable') ->saveProducts($mainConfigrableProduct, $simpleProductIds); Here $mainConfigrableProduct is configurable product object and $simpleProductIds is array of simple product id