Theory of electron tunneling from d bands in solids I. Application to field emission