First write the code to programmatically add a webpart to a single homepage. The specifics of how to do this will vary based on how your homepage is structured, whether it's a publishing page, etc. It's most likely possible, but implementations could differ. You'll possibly be using something similar to this:
using(SPSite site = new SPSite("http://localhost"))
using(SPWeb web = site.RootWeb)
{
web.AllowUnsafeUpdates = true;
SPLimitedWebPartManager webParts = web.GetLimitedWebPartManager("Pagees/Home.aspx"
, System.Web.UI.WebControls.WebParts.PersonalizationScope.Shared);
MyWebPart wp = new MyWebPart(); // your custom webpart
wp.Title = "My WebPart";
webParts.AddWebPart(wp, "Left", 0);
webParts.SaveChanges(wp);
}
There are lots of variations when searching the subject online.
Once you have that you can create either a console application or a feature to be executed on the top level site, open up each subsite, and then execute the above code.