Forward physics with the CMS experiment at the LHC