You could use SPDeploy from Codeplex (of which I'm a contributor).
You supply an XML file (there samples included, as well as full XSD so you can get intellisense when building your XML), and SPDeploy will create the structure.
You want to create hundreds of teamsites though, so you'd have to create hundreds of lines of XML for it to provision the sites (and the SPDeploy process itself will certainly take a few hours to do this).
So another option is to create a simple command line application that creates site collections and subsites using something unique for the titles and urls (a text concatenating the current time or something) all inside a couple of for loops.
For generating content, there is the ImTech TExt Content Generator - http://imtech.codeplex.com/releases/view/8877- but that is done through the UI and you'd need to connect to each site in turn and generate the data.
Another option for that is just another method in a console app which is creating the sites, which creates a couple of lists and throws in a few thousand rows.
For your initial problem of creating MySites, you'd first need thousands of users in AD* (plenty of scripts on the web for doing this), then use the UserProfile Manager to get the UserProfile object for each user in AD, and call CreatePersonalSite() for each profile.
*Someone confirm for me if you do actually need to do this.