In your index.php (and maybe admin.php) after you create an instance of the XenForo_FrontController but before you $fc->run() it you'll need to log the user into XenForo. If you've validated the main site's session and have found the appropriate xenforo user_id you can call XenForo_Model::create('XenForo_Model_User')->setUserRememberCookie($userId, $auth); to set the login cookie. Once that is done, XenForo_Session should pick everything up appropriately and treat the user as logged in. It'll set the xf_session cookie based on the user you logged in via that method.
This isn't a perfect method but it should get the job done for you.
As a side note, be sure to clear all the xenforo cookies when you log the user out on your main site or else you'll end up with mixed session states.