Quantum corrals are nanoscale structures formed by positioning individual atoms into geometrical arrangements that form closed structures using the STM. They can be used to control the spatial and spectral distribution of surface electrons. The theoretical modelling of these systems is described and illustrated, and the application of the corrals as quantum laboratories for controlling the interactions of surface-state electrons is described. A new three-dimensional scattering model is introduced that extends the description of the electron states within quantum corrals and which can form the basis of many-body calculations of the lifetimes of confined electrons.