Oxidation of Carbons
There are several ways to determine oxidation number/state. The most useful method for organic (covalent) compounds uses the following three rules, and works for most elements engaged in covalent bonding (just replace carbon with some other element):


Every bond between a carbon atom and a more electronegative atom increases the oxidation number of that carbon atom by 1.
Every bond between a carbon atom and a less electronegative atom (hydrogen is most common) decreases the oxidation number of that carbon atom by 1.
Every bond between a carbon atom and another carbon atom has no effect on the oxidation number of the carbon atom (although we could get more complicated since carbon atoms with different "hybridizations" have different electronegativities).


This approach is equivalent to assigning all of the electrons in a covalent bond to the more electronegative atom for purposes of determining oxidation number. This page on Master Organic Chemistry has a number of examples.

Here's an example from the Wikipedia article on the matter, using acetic acid:



Atom            Bonds to   Contribution to Ox# 
H (methyl)       C         +1 (2.5 &gt; 2.1)
          TOTAL Ox#        +1 
C (methyl)       H         -1 (2.1 &lt; 2.5)
                 H         -1
                 H         -1
                 C         +0 (same atom)
          TOTAL Ox#        -3
C (carboxyl)     O         +1 (3.5 &gt; 2.5)
                 O         +1 (double bond counts as 2 bonds)
                 O         +1
                 C         +0
          TOTAL Ox#        +3
O (carbonyl)     C         -1 (2.5 &lt; 3.5)
                 C         -1
          TOTAL Ox#        -2
O (hydroxyl)     C         -1 
                 H         -1 (2.1 &lt; 3.5)
          TOTAL Ox#        -2
H (hydroxyl)     O         +1 (3.5 &gt; 2.1)
          TOTAL Ox#        +1