private void SetMaster(SPWeb web, string masterpagePath, string custommasterpagePath)
web.CustomMasterUrl = masterpagePath;
web.MasterUrl = custommasterpagePath;
foreach(SPWeb child in web.Webs)
SetMaster(child, masterpage, custommasterpage);
if(child != null) child.Dispose();
Call this passing the SPSite.RootWeb, and specifying the path to your master pages. It'll recurse over all the sites below that rootweb in the site collection (i.e. all of them!)
Note that you may need to consider whether the sites below use different master pages as this can cause problems, particularly with Meeting Workspaces, but possibly others.
You may also need to consider storing the original master pages details in the property bag for the web so you can restore them later (e.g. feature deactivation)
And you may wish to make sure that themes are turned off and don't interfere with your look and feel.