(You can skip directly to the question, but the context is on the background section.)
Technical Context
Your hosts file needs to match your IIS bindings, which have to match the url browser.
So if your hosts file looks like:
127.0.0.1 siteA.localhost
127.0.0.1 siteB.localhost
Your IIS bindings need to be:
site host header port
siteA siteA.localhost 80
siteB siteB.localhost 80
Finally, from the local machine, you need to browse to:
http://siteA.localhost
EDIT - If you are trying to do the above without adding the hosts entries for siteA and siteB, it won't work. DNS won't find it. So for example, what happens if you try to browse to "foo.stackoverflow.com" - the request will fail even though "stackoverflow.com" is a known address.