As I told before: pointing "*.localhost" to "localhost" is the job for a DNS server. In this case, the DNS server answer all questions for a hostname in the `domain` "localhost" with the same IP (here 127.0.0.1).
And the Apache webserver answers to all requests for the IP to which he listen.

BTW:
You only need virtual hosts, if you have different content for different hostnames.