Food safety has always attracted considerable attention in Beijing, the capital of China; however, very few studies have investigated the heavy metal (HM) pollution, dietary exposure, and health risk assessment of the high dietary structure of cereals, legumes, and their products (CLPs). Herein, we collected seven types of CLP samples, i.e., rice, wheat flour, dried noodles, corn porridge, millet, mung bean, and soybean from the 16 districts of Beijing, and used atomic spectrometry to detect the concentrations of Cd, Cr, Pb, Cu, Fe, Mn, and Zn in the CLP samples. Further, we evaluated the contamination degree of Cd, Cr, and Pb in the CLP samples using the Nemerow pollution index method (NPIM). Finally, we assessed the dietary exposure and health risk based on the HM contents and dietary structure of the Beijing residents. The results denoted that the CLPs sold in Beijing were safe and that the daily exposure doses (DEDs) of Cd, Cr, Pb, Cu, Fe, Mn, and Zn were 0.0772, 0.2251, 0.3350 μg kg·d−1, 0.0119, 0.0417, 0.0367, and 0.0505 mg kg·d−1, respectively. The hazard quotients (HQs) of the aforementioned HMs were 0.08, 0.08, 0.24, 0.32, 0.06, 0.22, and 0.17, respectively. The integrated hazard index (HI) was greater than 1 but less than 10, indicating that the long-term consumption of these CLP samples may cause non-carcinogenic adverse effects to the Beijing residents. Furthermore, this study denoted that Cr, Mn, and Cu may damage the Beijing residents’ health through dietary consumption compared with the remaining HMs. We believe that providing quick response (QR) code labels on a commodity containing information about the supplier, producer, and vendor would reduce China’s future food safety issues.