From what I know (and maybe wrong), its 2 part process. Main part is that you need to somehow configure your webserver to "listen" to this new domain. There are 2 ways:
- Enable wildcard domain for your site (*.site.com). This will make sure that any domain is redirected to the same site (so you can have xxx.site.com) and from there you figure out the subdomain using apache and get username.
- You add a line to httpd.conf to create a new vhost for every user. Coding aspects is still the same as first option.
The question now, I guess, is whether you know Apache or not? (assuming you have apache as your webserver).