Two choices: Create a Mirror Domain of the subdomain in the Panel: Domains -> Manage Domains. And create a Mirror Domain of example.com that points to sub.example.com
Or the more thorough approach:
1) If you don't already have the fully hosted main domain set up, do so. You'll get an example.com folder in your home directory.
2) Rename example.com to old.example.com and then rename sub.example.com to example.com
3) Go through your config files and update any directory paths and domain references for the new setup.