The construction via degeneracy loci definitely goes through in the general setting of a complex vector bundles over a smooth compact oriented manifold.

It is often referred to as Gauss-Bonnet type formulae.

You can find a nice account about that in "Principle of Algebraic Geometry" by Griffiths and Harris, Chapter 3, Section 3.