The easiest solution in my limited experience is to get an account with a unique IP address - an "IP-based virtual server"), typically available in the U.S. for about $1.00 more per month over a name-based virtual hosting account. This allows you to point as many domains and subdomains as you like at your server's IP address, and then use an .htaccess file in the top-level Web-accessible directory to 'sort out' all these domains and subdomains and point each of them to their own filespace. Within that separate filespace, you can have additional per-directory .htaccess files, and it will be possible for each 'site' to access shared code or objects in the top-level directory or other subdirectories of that top-level directory.
If you use a name-based virtual host, then you must explicitly declare/define each added domain and/or subdomain one-at-a-time in your "Control Panel," and sharing resources among them becomes problematic, as also recently discussed.
I just presented a simple example for subdomains in this thread [webmasterworld.com].
Jim