Hi lmeyers,
If you're creating subdomains on a single IP, can you explain why you need a wildcard on subdomains - do you plan on running one site on all subdomains on your site?
URL rewriting will be tricky to say the least, and until you can explain the background a little more, my recommendation is normally this: either just to use multiple sites, one IP, one host header on each for each subdomain if you plan on running single sites - or use one site, one IP, no host header so it catches all incoming traffic.
If you then want to do rewriting with the second option you have choices:
1) If your single site is running ASP.NET then you could write a URL rewriter as Frinny's link pointed to. I've had great success in this area, especially as ASP.NET now supports Regex and you can link it directly to database lookups too - especially useful for content management systems and advanced URL rewriting.
2) If you run multiple sites, single host header each, then
Ionic ISAPI Rewriter is the tool for you. Supports Regex lookups, header modifications, 301/302s, all in a nice ISAPI that you can dump straight onto the individual website to rewrite its' URLs.
3) If you really want to go down the route of programmatically controlling the host headers on a single site, then check out the
WMI IIS reference on MSDN which will give you all the class references and function calls necessary to create objects programmatically and then add/edit/remove host headers as necessary.
Hope this helps.
codegecko