Electromagnetic scattering from anisotropic materials, part I: General theory