I had to blog this here, because I have the need for it every once in a while, but not frequent enough to remember it... :)
A site hosted without a virtual directory: mysite.com/
A site hosted from a virtual directory: mysite.com/myVirtualDir
See the MSDN Documentation for more details and code examples.
See the "ASP.NET Web Site Paths" article for more ways to discover paths.