The two main computational techniques to calculate the microscopic electronic structure of localized defects in solids are reviewed. Cluster calculations using the Hartree-Fock method as well as density-functional methods have been widely used to determine the equilibrium structure of hydrogen and hydrogen-related complexes in semiconductors. Results for the structure of both acceptor-hydrogen and donor-hydrogen pairs in silicon obtained by various methods and at different levels of approximations are discussed. Comparisons are made among the calculated vibrational frequencies of hydrogen in these passivation complexes. The spin density distribution for bond-centred hydrogen or muonium in diamond is investigated. Owing to the light masses of the proton and the muon it is necessary to average the computed hyperfine parameters over the finite extension of the ground-state wave function.