The iEBE-VISHNU code package performs event-by-event simulations for relativistic heavy-ion collisions using a hybrid approach based on (2+1)-dimensional viscous hydrodynamics coupled to a hadronic cascade model. We present the detailed model implementation, accompanied by some numerical code tests for the package. iEBE-VISHNU forms the core of a general theoretical framework for model-data comparisons through large scale Monte-Carlo simulations. A numerical interface between the hydrodynamically evolving medium and thermal photon radiation is also discussed. This interface is more generally designed for calculations of all kinds of rare probes that are coupled to the temperature and flow velocity evolution of the bulk medium, such as jet energy loss and heavy quark diffusion.