From a textbook...
Oxidation number can be calculated by knowing which element has higher electronegativity value. Electronegativity of chlorine is greater than that of carbon and that of carbon is greater than that of hydrogen. The carbon-chlorine bond will have oxidation numbers as -1 on chlorine and +1 on carbon and the carbon-hydrogen bond as -1 on carbon and +1 on hydrogen. Therefore, the oxidation number of carbon is (+1)*3 + (-1)*1 = +2.