Work done by magnetic field on current carrying conductor Suppose a wire of length L carrying a current I is kept in a uniform magnetic field B perpendicular to the current. The force on the wire will be IBL and work done by magnetic force when wire moves a distance d along the force will be IBLd. But magnetic force cannot do any work on a moving charged particle and hence total work done on all particles by magnetic force should be zero. Where does the work IBLd come from?
 A: The work comes from the battery that is driving the current through the wire.
Even if the wire were stationary, the battery would be supplying work at a rate $I^{2}R$. But with the wire moving, the battery would need to be supplying extra work at a rate $\mathscr{E}I$ in order to overcome the emf generated by the moving wire.
Now, $\mathscr{E}$ is equal to the rate at which the wire cuts magnetic flux so $\mathscr{E}=BLv$ (in which $v=\frac{d}{t}$), so the extra rate of doing work has to be $\mathscr{E} I=BLvI=BLdI / t $. And this is equal to the rate of mechanical work done on the wire!
A: 
But magnetic force cannot do any work on a moving charged particle and hence total work done on all particles by magnetic force should be zero. Where does the work IBLd come from?

Sum of works of magnetic forces on each charged point particle in the wire  (assuming it is made of point particles) is indeed zero (this follows from the fact that magnetic force on point particle is always perpendicular to particle's velocity).
However, the macroscopic work $IBLd$ is not that sum; instead, it is work of a macroscopic force, acting on the whole wire. This macroscopic force is due to existence of current $I$ inside the wire, but it does not act on that current, it acts on the wire itself.
This macroscopic force is properly called motor force or motor action force, or ponderomotive force (also sometimes called the Laplace force). It is also common to call it simply magnetic force, due to its origin  - it appears due to presence of magnetic forces acting on the charge carriers. Unfortunately, it is also quite common to call it Lorentz force, but that is grossly incorrect. Lorentz force should refer only to force acting on a microscopic body such as the charge carrier.
The Laplace force acts on the body as a whole and it is not given by the Lorentz formula and it is not perpendicular to velocity of the body; hence it can, and often does work (electric motors).
It arises due to fact that charge carriers are confined to the wire, even while the Lorentz forces act on them; if there was no confinement, the Lorentz forces would make them curve their trajectory so as to escape from the wire on one side. This does not happen, as even slightest deviation of distribution of current inside the wire results in restoring force due to rest of the wire that keeps the charge carriers confined. By Newton's 3rd law, the charge carriers exert opposite force on the rest of the wire too - and sum of those is the Laplace force. Thus the Laplace force is internal force, acting from the charge carriers on the rest of the wire.
The work done by this force is thus work of internal forces in the wire, not work of the external magnetic field. The energy is funneled from the voltage source, through the EM field of the voltage source and the circuit, to the mechanical energy of the wire.
A: In the diagrams below, $v_{dr}$ is the mean drift velocity of the electron through the wire. Perhaps the diagrams say it all, but explanations follow.

When the wire is stationary (top diagrams) the magnetic Lorentz force (of magnitude $Bev_{dr}$) is to the right. The electron is restrained from being pushed out of the wire by a force from the wire that is essentially electrostatic. I've labelled its magnitude $F_{Lapl}$ because its Newton's third Law partner is the equal and opposite Laplace force that the electron exerts to the right on the wire. [The Laplace force is sometimes called the ponderomotive (!) force and, in the UK at least, the motor effect force.] For the stationary wire, $$F_{Lapl}=Bev_{dr}$$
In other words, in this case, the Laplace force is equal to the magnetic Lorentz force. 
The lower diagrams show what happens when the wire is moving to the right at speed $v_w$. Note the new resultant velocity, and the new direction of magnetic Lorentz force, at right angles to the resultant velocity. I've shown the magnitudes of the vertical and horizontal components of this force. 
The magnitude of the vertical force component is $Bev_w$, so this force component appears only when the wire is allowed to move at right angles to itself (thereby doing work); it gives rise to a back-emf. For $v_{dr}$ to be constant, this force component must be balanced by a force due to the electric field caused by the battery. I've (mis)labelled this force $eE_{batt}$. [I say "(mis)labelled" because $eE_{batt}$ is not the whole of the electric field force due to the battery; part of the force overcomes resistive forces (not shown) on the electron.] Thus$$eE_{batt}=Bev_w.$$
As with the stationary wire there is the force whose magnitude I've labelled $F_{Lapl}$, keeping the electron in the wire. If $v_w$ is constant,$$F_{Lapl}=Bev_{dr}.$$
This is exactly the same equation as for the stationary wire, but note that for the moving wire the Laplace force is not the same in magnitude or direction as the total magnetic Lorentz force, which is due to the total velocity of the electron!
Now for the energy aspect...
Power supplied to electron (not including that to do work against resistive forces) = $eE_{batt}v_{dr}=Bev_{w}\times v_{dr}$.
Work done per second by Laplace force = $F_{Lapl}\ v_w = Bev_{dr}\times v_w$.
So the work done by the Laplace force on the wire is equal to the work done by the force due to the battery, leaving no work to be done by the magnetic Lorentz force – just as it should be! [Although not strictly necessary, we could say that no net work is done by the Lorentz force, as the work done by the force of magnitude $eE_{batt}$ against the magnetic Lorentz force (vertical component) is equal to the work done by the magnetic Lorentz force (horizontal component) against the Newton's third law partner to the Laplace force!]
I believe that this resolves the paradox that the magnetic Lorentz force can do no work, yet work is done on/by the wire. 
Footnote
The set-up is, in fact, a machine, producing a motor effect force in response to the force of (usually) different magnitude, $eE_{batt}$, in a different direction. It is comparable in its action to a smooth slope up which we pull a body of weight mg, by applying to it a force, $F_{sl}$, parallel to the slope. Here we have$$F_{sl}=mg \sin\theta$$while the vertical velocity component is related to the velocity parallel to the slope by$$v_{vert}=v_{sl} \sin\theta.$$Hence Power in = work done per second by $F_{sl}$ = $mg \sin\theta \times v_{sl}$
and Power out = work done per second lifting m = $mg \times v_{sl} \sin\theta.$
This machine relies upon the normal contact force, N, between the body and the slope to keep the body on the slope, yet $N$, like the magnetic Lorentz force, does no work.
A: What you have described is actually a dc motor with an input of electrical energy and an output of heat and mechanical energy.  
A parallel rail version is often used to show the force on a current carrying conductor in a magnetic field.  

If the applied voltage from an external source is $V$ and the resistance of the circuit is $R$ and there is a complete circuit then a current $I$ will flow through the circuit.  
If yellow rod rolls along the rails at a speed $v$ then and emf $\mathcal E = BLv$ will be induced in the circuit.  
For that circuit we can write $V- \mathcal E = IR$ and multiplying each side by $I$ and rearranging the equation gives $VI =  I^2R + \mathcal E I$.
This final equation can be interpreted as the electrical power supplied by the external source $VI$ is equal to the power dissipated as heat due to the resistance in the circuit $I^2R$ plus the mechanical power done by the system $\mathcal EI$.  
In the case of the demonstration if the apparatus was large enough you could imagine that the rolling rod reaches a steady speed and the mechanical power is related to the work done against frictional forces.
The force which the wire exerts is $BIL$ and so the power delivered is $BILv = BLv \,\, I = \mathcal EI$.
With the standard "small" version of the apparatus what you see is the rod starting from rest and then accelerating when the current is switched on - the rod is gaining kinetic energy.
If you started to push the rod along the rails faster there might come a time when $\mathcal E > V$.
The current direction would then be reversed and the external source would be "charged".
The arrangement is then acting like an electrical generator.
Now you are doing the mechanical work which is converted into heat and electrical/chemical energy. 
