It depends on the hotel. You could just talk to the front desk staff and have them ready the bill early... and basically go through the same steps as a normal check out. I had a 29 day stay at a RI and it actually came out cheaper to have a 30 day stay instead, and I worked it out with them - left a day early but the 'official' check out was at the 30 day mark.
If the hotel has a fitness center with showers, that
may be an option, if they choose to be nice. I've done this once for an 11pm flight: I checked out that day and left my bags at the front desk for a few hours. I went out until it was about that time... then I asked them nicely to let me use the fitness facilities to take a shower and they were ok with it. I showered, got my bags and left for the airport.