I won't post steps, but I'll point you in the right direction. Someone correct me if I'm wrong.
If you are to flash a stock Rom, it shouldnt leave you rooted, since every stock Rom comes without superuser/superSU, which primarily is what gives you root access. Therefore, find a stock Rom and flash that.
As for custom recovery, I'm not exactly sure how to restore that. I don't see why you wouldn't be able to find, download, and flash the stock HTC recovery , for your phone.
Finally, for the bootloader lock, you'll need to completely restore that so it doesn't say TAMPERED/RELOCKED/UNLOCKED upon booting into bootloader.
Google how to do that. In fact, Google everything you need. That's what you should've done in the first place. Google is your best friend. After all, you're using an android phone.