Simulating the critical behaviour of complex fluids