First-order phase transitions and magnetocaloric effect by