spellcasting – Does Improved Pact Weapon allow casting a spell with somatic and material components using a Heavy-crossbow as the focus?

As stated in the title, I’ve read about casting spells with somatic component with two-handed weapons here.
The thing is that the Xanathar’s warlock invocation (Improved Pact Weapon) says that you can treat a weapon as a spellcasting focus. So the thing is, could I cast a spell of that type (fireball) with my two-handed crossbow?.

Thank you in advance.