If you have ever tried creating a website in IIS 6.0 by using WMI object model you would know that it is not easiest thing to do. There was no native support from IIS object model, IIS 7.0 has much improved Application Programming Interface (API) set , it quite simpler and straight forward.
Microsoft.Web.Administration is name space which contains majority of server objects, it also provides a convenient way of manipulating configuration files including AdministrationHost File, All APIs in IIS 7.0 object model are managed code.
Here is code listing to create a simple HelloWorld site (You need to add reference to Microsoft.Web.Administration namespace, it usually located at C:\Windows\System32\inetsrv
Creating a website, application pool and application
ServerManager serverMgr = new ServerManager();
//Create website
Site mySite = serverMgr.Sites.Add("HelloWorld",@"C:\inetpub\wwwroot\HelloWorld", 9292);
//Create application pool
serverMgr.ApplicationPools.Add("HelloWorld");
//Create application
mySite.Applications.Add("HelloWorldApplication");
//assign application pool to site
mySite.Applications["HelloWorldApplication"].ApplicationPoolName = "HelloWorld";
mySite.ServerAutoStart = true;
serverMgr.CommitChanges();
more to follow....