HfC and HfTaC2 coatings with gradient composition manufactured by double-cathode glow discharge plasma surface metallurgy technology were designed to improve the wear resistance of TA15 titanium alloy. The deposition mechanism of plasma and diffusion mechanism of atoms were investigated, and the growth process of coatings was revealed. The mechanical properties comprising microhardness and elastic modulus were investigated via first-principles calculations and experimental verification. The results reveal that the wear resistance of HfC and HfTaC2 coatings with abrasive wear mechanism is always better than that of the substrate with abrasive wear, adhesive wear and oxidation wear mechanism. The volume wear rates of the coatings are reduced by 90%–97% compared with the substrate, and that of HfTaC2 coatings are reduced by 29.9%–45.5% compared with HfC coatings. Furthermore, V-shaped cross section profiles of wear scars formed on HfC coatings, and U-shaped on HfTaC2 coatings, which is attributed to the addition of tantalum which causes HfC to form a sufficient solid solution, a 0.187–0.030 Å elongation of Ta-C bond length and 0.039–0.051 Å shortening of Hf-C bond length led to the unit cell shrinkage and the Bragg lattice changes from face-centered cubic to face-centered square lattice; accordingly, hardness and wear behavior were further improved.