Generalized Samuel Multiplicities and Applications