The Dipole Formalism for Next-to-Leading Order QCD Calculations with Massive Partons