A magnetic dipole in a magnetic field will have a potential energy related to its orientation with respect to that field. The dipole moment will preferentially be either spin up or spin down. A radio frequency signal of the proper frequency can induce a transition between spin states. This "spin flip" places some of the spins in their higher energy state. If the radio frequency signal is then switched off, the relaxation of the spins back to the lower state produces a measurable amount of RF signal at the resonant frequency associated with the spin flip. This process is called Nuclear Magnetic Resonance (NMR).
Note that the electron spin magnetic moment is opposite to the electron spin while the proton spin magnetic moment is in the direction of the proton spin. The electron spin or proton spin will tend to precess around the magnetic field with a frequency called the Larmor frequency which is proportional to the magnetic field.
It can also be visualized quantum mechanically in terms of the quantum energy of transition between the two possible spin states for spin 1/2. This can be expressed as a photon energy according to the Planck equation. The Larmor frequency of the electron spin is in the microwave region of the electromagnetic spectrum and is used in electron spin resonance.
The precession of the proton spin in the magnetic field is the interaction which is used in proton NMR. As a practical technique, a sample containing protons (hydrogen nuclei) is placed in a strong magnetic field to produce partial polarization of the protons. A strong RF field is also imposed on the sample to excite some of the nuclear spins into their higher energy state. When this strong RF signal is switched off, the spins tend to return to their lower state, producing a small amount of radiation at the Larmor frequency associated with that field. The emission of radiation is associated with the spin relaxation of the protons from their excited state. It induces a radio frequency signal in a detector coil which is amplified to display the NMR signal.
Since the Larmor frequency of the detected signal is proportional to the applied magnetic field, changing the magnitude of that field produces a different detected frequency. Placing a magnetic field gradient across a sample allows you to locate the source of the proton NMR signal in the sample. This is used to great advantage in the medical imaging process known as Magnetic Resonance Imaging.