In this AmJPhys article Griffiths discusses stationary electric and magnetic dipoles in external electric and magnetic fields.
For the case of a standard magnetic dipole (due to an electric current) at the origin in an external magnetic field ${\bf B}$, Poynting's Theorem gives the interaction energy between an external magnetic field $\bf{ B}$ and the field due to the dipole ${\bf B}_d$ as $$W_{int} = \frac{1}{\mu_0} \iiint {\bf B}_d {\bf \cdot} {\bf B} d \tau.$$
He then proceeds to write the external field in terms of the vector potential, ${\bf B} = \nabla \times {\bf A}$, and the interaction energy can be rewritten as $$W_{int} = \frac{1}{\mu_0} \iiint {\bf B}_d {\bf \cdot} \nabla \times {\bf A} d \tau = \frac{1}{\mu_0} \iiint \nabla \times {\bf B}_d {\bf \cdot} {\bf A} d \tau,$$ which, after identifying $\nabla \times {\bf B}_d$ with the current density ${\bf J}_d$ (assuming static fields), becomes $$ \iiint {\bf J}_d {\bf \cdot} {\bf A} d \tau.$$
After this it is argued that because the magnetic dipole is localised it is reasonable to expand the vector potential due to the external field in a Taylor series about the origin $${\bf A} ({\bf r}) \approx {\bf A} ({\bf 0}) + {\bf r} \cdot {\nabla_0} {\bf A} ({\bf 0}) + \cdots .$$
The integral involving ${\bf J}_d \cdot {\bf A}({\bf 0})$ vanishes leaving the final expression as $$W_{int} = \iiint d \tau {\bf J}_d {\bf \cdot} ( {\bf r} \cdot {\nabla_0} ) {\bf A} ({\bf 0}) = \iiint d \tau {\bf J}_d ( {\bf r} \cdot {\nabla_0} ) {\bf \cdot} {\bf A} ({\bf 0}).$$
This apparently can be written as $ {\bf m} {\bf \cdot} {\bf B}$ where ${\bf m} = \frac{1}{2} \iiint {\bf r} \times {\bf J} d \tau$ is the magnetic dipole moment and ${\bf B} = \nabla \times {\bf A}$ is the external magnetic field (dropping the subscript "$0$" which tells you the field is evaluated at the origin where the magnetic dipole has been placed). I am having difficultly getting this result and any help, hints would be appreciated.