In this paper, the structures of diamond-like carbon (DLC) films doped with carbide forming elements Me (MeTi, V, Cr, Zr, Nb, W) were designed firstly by molecular dynamics method. Then, the residual stress and mechanical properties of Me-DLC films were calculated. Meanwhile, the effect of doping carbide forming elements Me on DLC films were analyzed, which indicates the mechanism that the residual stress is decreased. The results show that the residual stress in Me-DLC films is compressive stress. With the increase of Me content, they are decreased firstly and then increased. Meanwhile, the smaller residual compressive stress of the DLC films is, the better their comprehensive mechanical properties are. By the structural analysis, it is found that the carbide forming elements Me are easily combined with the tri-coordinate C to increase the tetra-coordinate C content, which might affect the residual compressive stress. By the bond length and bond angle distribution analysis, it is observed that the CC bond length is relaxed and the CCC bond angle is deformed. By ELF analysis, it is found that a weak covalent bond is formed between the Me atom and the C atom, which lowers the bonding strength.