Time-of-flight secondary ion mass spectrometry (TOF-SIMS) is a sensitive surface analytical technology, which can simultaneously acquire diverse chemical components and their precise locations on the surfaces of samples without any requirements for chemical damage pretreatments or additional matrices. Commonly, the quality control of TCMs (traditional Chinese medicines) is limited by the qualitative and quantitative evaluations of the specifically extractive constituents. In this study, a practical sample preparation strategy named two-layered media embedding sample preparation was developed to obtain ideal freezing sections of dried materials of Cordyceps sinensis. Meanwhile, the well-established sample preparation method was applied for in situ chemical profiling and imaging of natural (NCS) and cultured Cordyceps sinensis (CCS) by using TOF-SIMS. More than 200 components were tentatively identified and imaged in NCS and CCS at the same time. Mass spectrometry imaging revealed that most components have even distributions in caterpillars of Cordyceps sinensis, while TAGs, DAGs, MAGs, and FAs only have distributions outside caterpillars’ digestive chambers. This is the first time that components were in situ imaged for Cordyceps sinensis to exhibit the chemical distributions which have never been achieved by other analytical techniques so far. In addition, chemometrics was used to simplify and explain the massive TOF-SIMS mass data sets, which revealed the high chemical similarity between CCS and NCS. Furthermore, the relative quantification of TOF-SIMS data showed that CCS has comparable proportions of amino acids, nucleosides, monosaccharides, sphingolipids, sterols and other principles to NCS except for fatty acids, glycerides and glycerophospholipids. The higher amounts of TAGs and DAGs in CCS were confirmed by quantitative 1H-NMR, indicating reliable relative quantification of TOF-SIMS. In general, our research developed a novel approach of TOF-SIMS for in situ chemical analysis of TCMs, and its successful application in comparative study of CCS and NCS suggested that TOF-SIMS is an advanced and promising analytical technology for the research of TCMs.