If you have access to Xanathar's Guide to Everything, Melee Warlocks and Eldritch Blasters can be roughly equivalent in power.
Xanathar's Splatbook introduces a new power source for the warlock, in the form of an Otherworldly Patron tied to sentient magic weapons. This warlock sub-class, the Hexblade, receives a nifty feature at level 1 that allows him to use his charisma modifier for attack and damage rolls with a single chosen weapon, as well as with any Pact of the Blade weapon he could conjure. This makes the melee warlock much more viable, as they are no longer sacrificing spell power to boost their martial prowess.
Feats and Invocations
For an Eldritch Blaster, combat prowess comes mostly through invocations, agonizing blast being the most notable one. While most Eldritch Blasters will pick up Spell Sniper at some point, it is not mandatory for Eldritch Blast to be effective. Indeed, invocations such as Eldritch Spear (increased range), Repelling Blast (10ft knockback), Grasp of Hadar (10ft pull) and Lance of Lethargy (10ft slow) can add tremendous utility to Eldritch Blast, granting it properties similar to other utilitarian offensive cantrips while keeping a high base damage.
For the Bladelock, the biggest increase in offensive power comes through feats. While invocations such as Thirsting Blade (extra attack) and Lifedrinker (add charisma modifier to damage) are mandatory, what allows a melee-oriented warlock to keep up somewhat with other classes is the Polearm Master feat. With this feat, a warlock is able to obtain a third attack each round using his bonus action. This third attack has a slightly reduced damage (1d4 vs 1d10) but, unlike the additional attack granted by dual-wielding, gets to add all stats modifiers to damage. This is especially important to the Hexblade, as it allows him to add his charisma modifier twice.
This damage can be further increased by the use of the Great Weapon Master feat (at the cost of accuracy), or the use of the Eldritch Smite invocation (at the cost of spell slots). Alternatively, a melee warlock is more likely to get hit by enemies, making Armor of Agathys a very powerful option both defensively and offensively, as it does not require concentration to maintain and can deal a lot of damage per fight at higher levels, assuming the temporary HPs can withstand a few attacks.
If you don't want to use a polearm, consider starting your first level as a fighter (heavy armor proficiency, 2 more HPs and a free fighting style) and go the dual-wielding route. Once you can summon a Pact Weapon, you can use two weapons with your charisma (though only one gets to apply cha x2 to damage rolls). It's a slight reduction in damage, but allows for much more variety while affecting your action economy similarly to what a polearm would.
Damage comparison between Eldritch Blast and Polearm Master
Assuming human warlocks with a free feat at level 1, the Eldritch Blaster has likely opted for Spell Sniper and the Bladelock took Polearm Master. This table assumes that no other damage boosts apply to both of these warlocks, only base weapon and cantrip damage.
- Level 1 : 1d10 (5.5) vs 1d10+3 + 1d4+3 (14)
- Level 2 : 1d10+3 (8.5) vs
1d10+3 + 1d4+3 (14)
- Level 4 : 1d10+4 (9.5) vs 1d10+4 + 1d4+4 (16)
- Level 5 : 2d10+8 (19) vs 2d10+8 + 1d4+4 (25.5)
- Level 8 : 2d10+10 (21)
vs 2d10+10 + 1d4+5 (28.5)
- Level 11 : 3d10+15 (31.5) vs 2d10+10 +
- Level 12 : 3d10+15 (31.5) vs 2d10+20 + 1d4+10 (43.5)
- Level 17 : 4d10+20 (42) vs 2d10+20 + 1d4+10 (43.5)
In practice, however, an Eldritch Blaster can make a slightly better use of Hex, as transferring the curse requires a bonus action to perform and plays badly with Polearm Master's required action economy. But even factoring for the use of Hex, a melee warlock can mostly keep up with the Eldritch Blaster in damage, except for level 11, where the Eldritch Blaster gets a significant power up slightly earlier than the Bladelock. In fact, up to level 11, the Bladelock outdamages the Eldritch blaster on average, assuming that he can use his extra polearm attack at least once during the fight on an enemy under the effect of Hex.
Availability of equipment
Offensively, the Hexblade isn't much different from the other subclasses, at least regarding their equipment's contribution to their attacks. Short of a few stronger magical focuses (the Staff of Power comes to mind), an Eldritch Blaster can commonly only improve his chances to hit, but not his damage, via a Rod of the Pact Keeper. On the other hand, a Hexblade can use any magical weapon as his chosen weapon, adding it's magical modifier to both attack and damage rolls. Using the Pact of the Blade feature, a Hexblade could potentially keep two different magical weapons on hand for more versatility, and still benefit from using his charisma modifier with both.
Interestingly, magical items that would increase an Eldritch Blaster's damage output are actually stronger on a Bladelock. Indeed, items such as the Staff of Power and the Staff of the Magi grant the Bladelock the same advantages as they would an Eldritch Blaster, while being 100% compatible with the Polearm Master feat. Furthermore, a staff of Striking can grant additional damage dice on melee hits to the Bladelock, not unlike the Smite ability of a Paladin. The staff itself is a slight damage drop compared to a glaive or halberd, but their potential added properties are pretty interesting and should not be underestimated.
Regarding defense, the Hexblade is proficient with medium armor, as well as shields. This means that a high dexterity score is much less important, as a 14 is sufficient to obtain an AC of 17 with a half-plate armor. While a dexterity score of 20 could reach an AC of 18 with mage armor, this is usually at the cost of a lot of magical power, as charisma becomes a secondary stat. The Hexblade, using charisma for his melee attacks, can concentrate on charisma first.
Technically speaking, it is also possible to wield a quarterstaff in one hand. This reduces the Hexblade's damage considerably (1d6/1d4 instead of 1d10/1d4), but it allows him to benefit from his shield proficiency and his Polearm Master feat. It makes little sense conceptually speaking, but it apparently works according to the rules. As such, the Hexblade's base AC could become 19. And with two pieces of equipment that add to armor, this means that the Hexblade can get both a magical armor and a magical shield, putting him far ahead in terms of defensive capabilities at the cost of a little bit of damage (4 dmg per round on average if all attacks land). In this context, a Staff of Power becomes a very strong defensive tool, as it also grants +2 to AC. To maximize the subclass' versatility, a Hexblade can attune a magical staff to use with a shield when defense is the best option, and use his Pact Weapon feature to summon a Glaive or Halberd when offense is required.
Spellcasting while using a two-handed weapon or a shield
Casting spells with somatic components when wielding a shield or a two-handed weapon becomes harder, but a Hexblade will probably buff himself in-between fights with concentration-less spells such as Armor of Agathys (lasts 1 hour or until the temporary HPs are spent) rather than cast damaging spells during the fight. Assuming you carry your staff when out-of-combat with the same hand that is holding the shield, you can cast Hex on your first round of combat, then draw the weapon as part of your first attack.
If you are using a two-handed weapon, you can still cast spells requiring somatic components by removing one hand from the weapon. If you carry a component pouch or a crystal on a string around your neck, your item interaction should allow you to use it as a focus as well. The Warcaster feat (can use your weapon for somatic components) and Improved Pact Weapon invocation (can use your weapon as a focus) both help this maneuver a bit as well.
Throughout their careers, both the Eldritch Blaster and the Hexblade will have similar damage output. Until level 11, the Hexblade will have a slight advantage in damage provided he has the Polearm Master feat. At higher levels, the difference in offensive powers will be very small, with a slight advantage to the Eldritch Blaster when Hex is factored in.
In the end, it's mostly a playstyle choice. If you wish to play a spell slinging warlock, it's probably best to use Eldritch Blast and remain in the back, protected by your squad mates. If you'd rather be in the thick of it, you will get a similar damage output using a polearm, at an added risk of injury. Luckily, the Hexblade is also proficient in medium armor, making it slightly easier to optimize AC without a high dexterity score.