  We develop a study on local polar invariants of planar complex analytic
foliations at $(\mathbb{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\'e problem for
foliations on the complex projective plane $\mathbb{P}^{2}_{\mathbb{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 $\mathcal{F}$. We characterize the existence of a solution for
the Poincar\'e problem in terms of the structure of the set of local
separatrices of $\mathcal{F}$ over the curve $S$. Our method, in particular,
recovers the known solution for the non-dicritical case, ${\rm deg}(S) \leq
{\rm deg}(\mathcal{F}) + 2$.
