RAW, but underpowered and likely boring
As Thomas Markov suggests, start with a CR0 Juvenile Mimic using the Sidekick rules from TCoE.
A sidekick can be any type of creature with a stat block in the Monster Manual or another D&D book, but the challenge rating in its stat block must be 1/2 or lower.
Then, level up the juvenile mimic as you level:
Whenever a group's average level goes up, the sidekick gains a level...it gains one Hit Die, and its hit point maximum increases.
Level it as a warrior sidekick. All of the abilities will be useful, but you will get the most mileage from martial role (1st, defender), improved critical (3rd), ASI (4th and 8th - all to Dex), Extra Attack, and Battle Readiness. As a note about the ASI, you can't do much with its Str 1 by the Sidekick rules, but you can start at Dex 12 (juvenile) and, as the juvenile does, use its bite attack based on Dex rather than Str, increasing its to-hit with each 2-point Dex boost.
Note that the juvenile mimic does not have the Adhesive of an adult mimic, so you don't need to worry about it sticking to things or things sticking to it.
When you draw the mimic from its sheath, it at first looks like smooth, sharp steel sword (false appearance). But then, during the round you are casting your defensive spell in preparation for combat, it uses its shape-shift to become a type of rere, a sword covered in teeth - and dripping with acid. Then, when the mimic attacks, it uses its Bite, doing piercing and acid damage.
As far as the hexlock, you simply take the Help action each turn, granting the mimic advantage on the first of its next attacks:
Alternatively, you can aid a friendly creature in attacking a creature within 5 feet of you. You feint, distract the target, or in some other way team up to make your ally's attack more effective. If your ally attacks the target before your next turn, the first attack roll is made with advantage.
The "some other way" you team up with the mimic is by wielding it as a sword while the mimic makes its bite attacks. That doesn't give your hexlock a lot to do, since you are constantly sacrificing your main action to help your sword sidekick attack, so you would need to be pretty invested in the concept. You can focus on defensive spells like shield, false life (with fiendish vigor), armor of agathys and so forth, but all your hex powers will be underutilized since it will be the mimic who is damaging things, not you, and the mimic can't be your pact weapon, so the invocations that synergize with your pact weapon will be of little utility. It would be great if you had an attack as a bonus action, but that's a pretty limited option RAW. To some extent you would be playing the sidekick as your character, and using your actual PC as the vehicle to level up and create abilities for the sidekick to use. Thus your hexlock themselves would be greatly sub-optimized and underplayed, and might not be fun unless you are into that or everyone in your party had similarly disadvantaged character concepts.
One strategy might be to invest heavily in the invocations that enhance your eldritch blast, use this at a distance, and only use the mimic when you stumble into melee - but that wastes your selection of subclass as hexblade. Another possibility would be to have your pact weapon be a throwing weapon that you could wield in one hand while holding the mimic in the other, and invest your invocations in things that will buff your thrown pact weapon as you move between thrown weapon and melee weapon range.
Making the mimic magical, and having it devour souls would be strictly homebrew, though.