Ultraluminous Infrared Galaxies are powered by starbursts and AGNs. In order to measure the relative contributions of these two energy sources in ULIRGs, we need to be able to detect the presence of heavily buried AGNs, whose continuum can be observed only in the mid-IR and hard X-rays. I present new diagnostic tools and simple models, based on low-resolution 3-8 micron spectra of local ULIRGs (obtained with 8m ground based telescopes and Spitzer), which provide a precise measurement of the relative contribution of AGNs to these objects. I also discuss the application of this method to high redshift sources, such as the bright galaxies found in 24-micron and Scuba surveys.