I pulled a superb tool from
MySite Stapling proj from MS.
But it did not have everything I needed. Particularly the loading web parts on to the home page. We had written a cross site content query and acquired several 3rd party web parts, and needed the webparts to appear on the mysite home page - default.aspx.
Web parts can either inherit from Microsoft.SharePoint.WebPartPages.WebPart or System.Web.UI.WebControls.WebParts.WebPart. The original MySiteCreate.cs would only load sharepoint web parts. The feature looked at the default page, finds a control and its assembly and then uses reflection to load it. It uses the MySiteStaplee.xml to set the properties.
I have uploaded the complete solution. To use it you will have to have already read the "Customizing MOSS 2007 My Sites within the enterprise" blog.
MySite C# Solution