Heterogeneous electrocatalytic reactions only occur at the interface between the electrocatalyst and reactant. Therefore, the active sites are only necessary to be distributed on the surface of the electrocatalyst. Based on this motivation, here, we demonstrate a systematic study on surface tuning for a carbon-based electrocatalyst from metal-free (with the heteroatoms N and S, NS/C) to metal-containing surfaces (with Co, N, and S, CoNS/C). The CoNS/C electrocatalyst was obtained by pyrolyzing the Co precoordinated and p-toluenesulfonate-doped polypyrrole (PPy). It was found that the coordination of Co on the PPy ring tuned the final carbon electrocatalyst into a catalyst with a CoNx moiety-rich surface. In addition, the as-synthesized CoNS/C was determined to have a very high loading of cobalt up to 2.02 wt %. The pyrolysis of the cobalt-containing precursor tends to proceed toward a characteristic of a higher sp2 carbon content, a higher surface area, and more nitrogen as well as active nitrogen sites than its metal-free counterpart. The most distinguished feature for such a catalyst is that the truly most active component is only distributed on the surface, in contrast with that of the conventional metal-N-based catalyst present throughout the bulky structure. Especially, the electrocatalytic activity toward oxygen evolution reaction (OER) has been investigated experimentally and theoretically. The results showed that the OER performance of the carbon-based electrocatalyst was remarkably boosted after the introduction of Co with an overpotential decrease from 678 to 345 mV at 10 mA cm-2. Furthermore, CoNS/C displayed an excellent durability upon a long-term measurement. The apparent activation energy measurements revealed that the metal-rich surface contributed to overcome the energy barrier for OER. In addition, density functional theory calculations have been conducted to explain the correlated OER mechanism. This study is expected to provide an effective strategy for the design and the synthesis of highly active metal-nitrogen-type electrocatalysts with a high metal loading for various electrocatalytic reactions.