Check this thread: Programatically create a web site in IIS using C# and set port number if you're using IIS 7 you can programmatically access all registered sites. Keeping in mind the thread I provided discusses how to add a site programmatically, you should be able to use the "sites" collection to access all registered services and search for those by name or by other criteria (you'd have to check what properties are available).
ServerManager iisManager = new ServerManager();
iisManager.Sites; //Use this collection to find the services you need to know exist
It's also important to note that if you're interested in the application pool as well you'd access them like so:
ServerManager serverManager = new ServerManager();
ApplicationPoolCollection applicationPoolCollection = serverManager.ApplicationPools;
Finally, your application will need to run under an account with the appropriate permissions to read this information.