Casting a spell with somatic and material components with a Heavy-crossbow that is a 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.