We derive an explicit partial-wave (Mie) series for the image of a dielectric microsphere collected by a typical infinity-corrected microscope. We model the propagation of the illumination and scattered vector fields through the optical components of the microscope by using the angular-spectrum theorem with the help of Wigner rotation matrix elements, allowing us to identify the contribution from spin-orbit helicity reversal. We consider a high numerical aperture objective well beyond the validity range of the paraxial approximation. The spherical aberration introduced by refraction at the planar interface between the sample and the glass slide is fully taken into account. By comparing our theoretical model with images of colloidal particles placed at different positions with respect to the objective focal plane, we characterize their radii and refractive index. We employ polystyrene microspheres with a known refractive index in order to fit the transverse attenuation length describing the transmission loss of the scattered field. As an application, we measure the radius and refractive index of individual silica beads. We compare the result for the radius with an independent measurement using high-resolution scanning electron microscopy. To validate the result for the refractive index, we develop a second method, independent of the theoretical model, based on the image contrast in glycerin-water solutions. In all cases we find very good agreement between our method and the validation procedures. In addition, the nonparaxial theory provides a reliable description of the images found for all focal-plane positions and for both polystyrene and silica microspheres. Our approach allows a common optical microscope to be used to measure the refractive index and radius of spherical particles covering the entire size range from the Rayleigh regime to the ray optics one.