First-order phase transitions and giant magnetocaloric effect