The Compact Muon Solenoid (CMS) is a multi-purpose detector which will be operated at the Large Hadron Collider (LHC) at CERN. Its excellent tracking system, combined with low transverse momentum muon trigger capabilities, allow for precise studies of heavy flavor decays. The capabilities of the CMS experiment in this field have been studied in several benchmark processes. These studies are based on a full detector simulation and show the capability of CMS to identify, select and reconstruct heavy flavor decays, which present a significant challenge due to the relatively low momentum and high background. After a description of the detector, the trigger system and the trigger strategy for B physics, several heavy flavor analyses in CMS will be presented including the exclusive Bs decays to J/psi phi, and to mu+mu-, the decay tau to 3mu, and Bc and direct charmonium production.