ok, so let the µC produce a voltage, say 1V
you feed that to the opamp as the reference
then you feed the voltage drop of the shunt resistor to the other side, as the feedback, and the output of the opamp drivers the transistor
so the opamp will now do whatever is necessary to the trasnsitor to make the current through the shunt drop 1V