You need free wheeling diodes to direct the current from back EMF to the supply. The usual driver circuits have that. The supply must be able to take up the extra current, that otherwise would raise the voltage too high. Usually just sufficient capacitance at the supply is enough.
Usually the main source is just the inductance, so the energy is rather limited: here E = 0.5 I²*L = 19,2 mJ. So not really much. At 40 V, that is only some 0.5 mAs or 0.5 V rise in a 1000 µF capacitor. Due to losses the actual energy will be lower. So something like a 1000 µF capacitor and a supply / driver that can stand a 1 V voltage rise should be enough.
The only exception would be, if the motor really has to work as a generator to slow down heavy parts. Than you might need a sink for the energy, e.g. a 2 quadrant supply or an extra circuit for over voltage limitation (e.g. a kind of power zener diode at 50 V).