yea, I sense a bit of confusion in your post. A Virtual Machine (VM) is just that; a logical and completely seperate, we'll say, instance of emulated hardware upon which you install an operating system like Linux or Windows.
The whole HTTP and DNS concepts are not related to VMs! A domain like stackexchange.com may be hosted on multiple physical or virtual machines in order to load balance or just generally keep content separate.
You can host multiple domains (stackoverflow.com, stackexchange.com) on a single IP address. This is part of the HTTP 1.1 specification. Under Apache it's called name based virtual hosts (vhosts for short). Same capability exists in Microsoft IIS.
Since web server software (Apache and IIS) run within the context of an operating system (Linux and Windows respectively), you would need either a VM or physical hardware to run either OS and the web server software (apache, IIS).
Apache/IIS (and others) bind themselves to the IP stack within the operating system which, again, is running on either a VM or physical hardware. The IP stack and all the related management associated with managing IP addresses, IP resolution (called the resolver) is OS specific. Under Linux, for example, you deal with /etc/resolv.conf on many distributions or you can set up BIND to respond to DNS requests to convert things like stackoverflow.com to an IP address.
So you could have a single Linux VM running Apache and hosting multiple web sites on a single IP address!
The trick is to making the marriage between DNS and your web server software all work together or in concert so that the different protocols (http, dns) are correct. NOTE: You can host DNS outside of your VMs too.
hope this helps
To answer the other part of the question about how to get a single public IP to hit multiple VMs or physical computers running web sites, you need a reverse proxy. Apache does this; not sure about IIS and there is HAProxy that can do this too.
You can, for example, have HAProxy listen on the single PUBLIC IP and then route traffic to the correct internal server on a private IP. Keep in mind that there is two way communication here -- so a reply from your web server needs to show up as if it came from the single IP.