The force from a magnetic field is given by the magnetic part of the Lorentz force equation:
$$\mathbf{F} = q \mathbf{v} \times \mathbf{B}.$$
The work done by any force is given by the path integral:
$$W = \int_{\mathrm{start}}^{\mathrm{end}} \mathbf{F} \cdot \mathrm{d}\mathbf{x}.$$
If we parameterize the path in terms of time we can rewrite the work integral as:
$$\begin{align}
W &= \int_{t_0}^{t_f} \mathbf{F}\cdot \frac{\mathrm{d} \mathbf{x}}{\mathrm{d} t} \,\mathrm{d}t \\
& = \int_{t_0}^{t_f} \mathbf{F}\cdot \mathbf{v}\, \mathrm{d}t.
\end{align}$$
The integrand in the second line is one way of writing the power (rate of exchange of energy).
The point being, since the magnetic force is always perpendicular to the velocity, the integrand is always zero, so the work is zero, too. It doesn't matter if the magnetic force is the only one acting or not.
The magnetic field can store energy, though, but that energy is added to it and removed from it indirectly through the electric field according to Faraday's law.
Take the Faraday-Maxwell equation, and dot both sides with $\mathbf{B}$:
$$\mathbf{B}\cdot \left(\nabla \times \mathbf{E}\right) = - \mathbf{B}\cdot \frac{\partial \mathbf{B}}{\partial t}. $$
The right hand side is equal to $- \frac{1}{2} \frac{\partial}{\partial t} \left(\mathbf{B}\cdot \mathbf{B}\right) = -\mu_0 \frac{\partial}{\partial t} u_B $, with $u_B$ the energy density in the magnetic field. Thus:
$$\Delta u_B = -\frac{1}{\mu_0} \int_{t_0}^{t_f} \mathbf{B}\cdot \left(\nabla \times \mathbf{E}\right) \, \mathrm{d} t. $$