We develop a study on local polar invariants of planar complex analytic foliations at (C 2 , 0), which leads to the characterization of second type foliations and of generalized curve foliations, as well as a description of the GSV -index. We apply it to the Poincaré problem for foliations on the complex projective plane P 2 C , establishing, in the dicritical case, conditions for the existence of a bound for the degree of an invariant algebraic curve S in terms of the degree of the foliation F . We characterize the existence of a solution for the Poincaré problem in terms of the structure of the set of local separatrices of F over the curve S. Our method, in particular, recovers the known solution for the non-dicritical case, deg(S) ≤ deg(F ) + 2.