Optical scanning probe devices offer an extremely efficient way of collecting local information on the complex structure of optical electromagnetic fields lying near a surface. This paper discusses recent theoretical efforts to develop an efficient method for the calculation of the field distributions in experimentally relevant near-field and integrated optics systems. In order to overcome the obstacles inherent in the matching of the electromagnetic boundary conditions on the surface of complex objects, the discussion is presented in the framework of the integral-equation formalism. This treatment is based on the field-susceptibility Green-function technique applied in real space. Two original numerical schemes, both based on a different discretization procedure, are discussed, and several numerical applications on systems of experimental interest are presented. Particularly, the problem of near-held distribution around three-dimensional objects of various sizes and shapes is investigated as a function of experimental parameters.