You are right in that the Work function (the term is more pertinent to metals in my opinion) or Ionization energy (a generic term) can be calculated as:
Evac - EHOMO. You can calculate the vacuum level in most DFT packages by doing a calculation for the average electrostatic potential in vacuum. This obviously makes sense only for a 2-D material (in bulk, the potential would just be asymptotic with out-of-plane distance).
For a vacuum calculation, you don't need to consider the bulk material at all. You can easily reconcile this because the work-function in the simplest texts is defined as removing an electron from the surface. You can just calculate the electrostatic potential for a range of out-of-plane distances and make sure it saturates ( if the vacuum is thick enough, this should not be a problem). In my experience, I've seen many papers on materials where the potential starts saturating for a distance of 0.1 nm (which is the minimum recommended vacuum in DFT calculations typically).
Edits: There is a slight distinction between EFermi and EHOMO. For semiconductors, at 0 K, the Fermi level is ill-defined. Can lie anywhere in the gap. But in literature, people plot bandstructures with Valence band maximum aligned to zero.