Simulation of spin systems with Langevin dynamics