When the company files for bankruptcy, the court appoints a bankruptcy trustee (Google this for more information). These are public employees of the DoJ, paid for by tax dollars. It's their responsibility to ensure that the assets get liquidated and the cash is distributed properly to creditors.
They will usually contract with one of the liquidation specialists mentioned above to handle the actual logistics of selling the assets. I'm not sure exactly how the liquidation house gets paid - I'd guess they take a commission on the sales. During recessions or bubble-bursts, you can often get great deals on office furniture and computers by looking for bankruptcy auction notifications. (In the absconding-to-China startup I mentioned, my boss called me up and said "Hey, if you want really cheap furniture, there's a liquidation auction going on in a couple weeks", but I was off at college at the time and didn't have space in my dorm room.)
This is all assuming you can't work something out amicably with all the parties involved. In many tiny tech startups - the ones that are a couple friends working out of their apartments with no investors - the founders just agree to put in job references for each other, split the company bank account evenly, let the IP & domain name die, and stop paying for any cloud services they're using. Sometimes if you have investors but the company clearly isn't going anywhere, you can arrange to return the remaining cash pro-rata and the investors will either fund your next venture or land you a job at one of their portfolio companies (Evan Williams famously did this with Odeo, and his next venture was Twitter.) You can avoid bankruptcy court and the whole liquidation process this way, you just need to have all your creditors & investors on board.