Confocal imaging is primarily based on the use of apertures in the detection path to provide the acquired three-dimensional images with satisfactory contrast and resolution. For many years, it has become an important mode of imaging in microscopy. In biotechnology and related industries, this technique has powerful abilities of biomedical inspection and material detection with high spatial resolution, and furthermore it can combine with fluorescence microscopy to get more useful information. The objective of this paper is first to present a generalized theoretical framework for confocal imaging systems, and then efficiently to design and implement such systems with satisfactory imaging resolutions. In our approach, a theoretical review for confocal imaging is given to investigate this technique from theory to practice. Also, computer simulations are performed to analyze the imaging performance with varying optomechanical conditions. For instance, the effects of stray light on the microscopic systems are examined using the simulations. In this paper, a modified optomechanical structure for the imaging process is proposed to reduce the undesired effects. From the simulation results, it appears that the modified structure highly improves the system signal-to-noise ratio. Furthermore, the imaging resolution is improved through the investigation on the tolerance of fabrication and assembly of the optical components. In the experiments, it is found that the imaging resolution of the proposed system is less sensitive than that of common microscopes, to the position deviations arising from installations of the optical components, such as those from the pinhole and the objective lens.