When you get a critical, you maximize the damage from any dice that you would normally have rolled from the attack, exclusive of damage that you would only obtain on a critical. If you had the opponent cursed and would normally be rolling an extra 1/2/3d6 damage because of it, then those dice are also maximized. If you used a magic weapon/implement that does additional dice on a critical or have a feat that produces extra damage dice on a critical, then those dice are rolled.
Example: A 10th level Warlock with a +2 Pact Sword and a INT bonus of 5 damage when using Eldrich Blast
Normal damage: d10(basic dice)+5(INT bonus)+2(Pact Sword bonus)+d6(curse)
Critical damage: 10(max damage die)+5(INT bonus)+6(max curse damage)+2(Pact Sword bonus)+2d6(Pact Sword bonus damage dice)