I've been browsing around trying to work this out - I think this is how it works, but then again I might be conpletely misdirected
http://companyA.example.com resolves to myserver:765
http://companyB.example.com resolves to myserver:234
Either your application picks up what port the request is coming through and from there is able to serve unique content for the company/user
OR
You have some kind of proxy/filter sitting in front of your application that puts something into the http header like "companyCode", then your application is on the look out for the companyCode http header
Does any of this sound roughly right?