Rotochemical Heating in Millisecond Pulsars: Formalism and Nonsuperfluid Case