What happens if you do emergency landing on a US base in middle of the ocean?
Wake Island has had aircraft divert there before, as it serves as an ETOPS diversion airport.

Per the remarks on AirNav and the NOTAMs:


  RSTD: VERY LIMITED OPERATIONS STATUS, AVBL FOR EMERG LDG AND MIN PRIORITY TFC.
  
  TRAN ALERT: SVCG FEES RQD. TRAN SVC HRS 2000-0400Z (0800L-1600L) TUE-SAT. CLSD SUN, MON, HOL.
  
  FUEL: FLIGHT CREW REQUIRED TO ASSIST IN REFUELING. J5(MIL). FLUID - W, SP, PRESAIR.


It's possible you could plan to fly through there with prior permission, as with most military fields. AirNav reports 2% of the average of 49 operations per day are transient general aviation, so it's not entirely military, but government and contractors probably make up most of this.

If your emergency is just that you forgot to have enough fuel, you should be able to get more fuel and depart again, for a fee. If there is a fuel leak or some other maintenance issue, you could be in for a longer stay.


  RSTD: NO AIRCRAFT MAINTENANCE AVBL.


As with the airliner that diverted, maintenance equipment and personnel will have to be flown in for any work that needs to be done.

You should be in contact with Oakland ARTCC through San Francisco ARINC in the oceanic airspace, and can call base operations ahead of time to advise of your needs. If it's outside of their normal staffing hours, they need at least 30 minutes notice to open back up.