Yes, Crossbow Expert allows you to pistol whip with a hand crossbow and then do the same thing as a bonus action
The first part of this interaction hinges on whether or not an improvised weapon is considered to be a weapon for the purposes of rules and features that depend on you doing something with a weapon. We already have a great question and answer about that here: Are Improvised Weapons used in melee actually melee weapons?
As NautArch's answer clarifies, improvised weapons don't strictly get to call themselves melee weapons or ranged weapons, since they exist outside that classification, and therefore aren't compatible with rules that refer specifically to melee weapons or ranged weapons - but they are still weapons at the moment you use them to attack, and luckily Crossbow Expert only specifies an attack with a one-handed weapon, not a melee weapon or a ranged weapon.
It seems obvious therefore that an improvised weapon wielded in one hand - lacking as it does the two-handed property - is a one-handed weapon, and so therefore taking the Attack action and making an attack with it satisfies the criteria which allows you to make a bonus action attack with a hand crossbow. That the hand crossbow is itself the improvised weapon you used in the first attack doesn't matter, since it's well established that shooting a hand crossbow also qualifies to let you make a bonus attack with the same hand crossbow.
Having established we get to make the bonus attack, the second question is whether or not the bonus attack could be used to make another melee attack with the hand crossbow as improvised weapon rather than having to shoot the crossbow normally.
Fortunately the language used in the feat doesn't seem to rule this out at all; it doesn't specify that you "shoot" the hand crossbow, or specify that you must use the crossbow to make a ranged attack - it simply allows that you can make an attack with the hand crossbow. The natural understanding of using the crossbow as an improvised club is that you are making an attack with the crossbow, even if it's not the one the crossbow was designed to make, so there is no conflict between the text of the rules and the action you want to undertake here.
TL;DR yes - attacking with a one-handed improvised weapon satisfies the criteria for Crossbow Expert's bonus attack, and the rules text for the bonus attack doesn't exclude using a hand crossbow as an improvised weapon in melee instead of shooting it normally.