In CO, the oxidation state of C is +2. The dative bond does not contribute in O.S. because it is made from high E.N. atom to lower E.N. atom.
I guess you're talking about COCl2, phosgene gas, right? It has a double bonded O and two single bonded Chlorines. So it'll be +4.