The phase stability, equilibrium lattice parameters, mechanical properties, and chemical bonding of M2B and M2B0.75C0.25 (M = Fe, Cr, W, Mo, Mn) were studied using first-principles calculations within density functional theory. These compounds are thermodynamic stability structures, and the M2B0.75C0.25 stability is worse than that of M2B. The equilibrium lattice parameters are consistent with other available experimental and theoretical data. Stress–strain and Voigt–Reuss–Hill approximations were used to estimate the elastic constants (Cij) and moduli (B, G, E), respectively. The bulk modulus and the ductility increased by adding an appropriate amount of C to the M2B. The compound hardness was studied using a theoretical method based on the work of Tian. The chemical bonding of these compounds was estimated using the Mulliken population analysis and density of states, and the results indicate that the bonding behaviors of these compounds are combinations of metallic and covalent bonds.