The analysis of data collected by the CMS experiment in 2010 (equivalent to an integrated luminosity of 40 pb−1) has yielded several physics results concerning the production mechanisms of heavy flavors at the unprecedented center-of-mass energy of 7TeV. Recostruction techniques of heavy-flavored particles will be discussed, with particular focus on the triggers expressly designed to select them. Measurements of the b¯b cross-section both with jet “b-tagging” techniques and exclusive states, such as B0, B± and B0s, will be presented, along with comparisons with theoretical predictions. Charmonium and bottomonium cross-section measurements, as well as the first determinations of the B-decay feed-down fraction for J/ψ, will be shown