In the appendix of Algebaric Geometry by Hartshorne, he show us that how Serre define the intersection number in a more general case:$i(X,Y;Z)=\sum{(-1)^i*(lengthTor^A_i(A/a,A/b))}$,
here X,Y intersect properly, Z is an irreducible component, A is the local ring of generic point of Z, a and b are the ideals of X, Y in A. However, when computing a detailed example like that X is an projective variety in $P^n$, Y is a complete intersection defined by $f_1,...,f_r$, I find it difficult to write down what the intersection number is. Sincerely hope for a detailed computing method.