Should be no problem, even with that sample. In this case, just add a wildcard to your DNS "*.yourdomain" and use the 'default' statement from the switch to handle wildcards.
In other words, change the sample for the Global.asax to something like:
default:
returnValue = new RouteData(this, new MvcRouteHandler());
returnValue.Values.Add("controller", "MyControllerName");
returnValue.Values.Add("action", "MyActionName");
// for example, provide the entered subdomain as parameter;
returnValue.Values.Add("MyActionParameterName", subDomain);
break;
And don't forget: add a wildcard to your DNS. It shall not be possible to test subdomains on localhost, though.