Not having much of a head for business, I think I'd try to estimate the amount of non-revenue time they save the directly-measurable employees. You count the time they save those employees as their revenue. You pay everyone about 1/4 to 1/3 of their revenues.

So if the contract specifies that the company gets paid $200/hr for developer labor up to 40 hr/week, you pay the developers $50/hr to $67/hr by the rule of thumb. If there were no support staff, they would each have to spend 2 hours a week on personnel management, which couldn't be billed to the contract. So an HR employee could support 25 other employees, since they can do the same work in 90 minutes (and still have to do the personnel management for themselves). Cleaning saves the specialists 30 minutes a week, so each supporting up to 119 other employees, since they can do the same work in 20 minutes (and still have to clean their own workspace). A manager saves each developer 8 hours a week, but can handle 10 developers (or 5 managers), since they can do that management work in half the time (and someone else manages them). The CEO is an otherwise uncounted manager of managers, paid out of the owner's share, so the first 5 managers don't require an additional manager to manage them.

You add as many support employees as are necessary to ensure that the employees directly measurable as making money spend all their working hours on making money, instead of something else. They get paid out of the fraction you didn't already pay to the revenue employee, and then the owners take what's left over. The closer you get to optimal productivity, the more calculations you have to do to get even better.

This would all go into a very complicated spreadsheet that changes the numbers based on how many direct-revenue employees there are, and how much support staff. Then I'd add a fudge factor so that if a measurable employee quits, nobody gets an automatic pay cut. This requires a lot of speculative hiring and firing in different categories. Everyone has to be paid according to the maximum they could be paid, if there were one more of them.

In this hypothetical, 20 developers have 2 managers, 1 HR, and 1 cleaner. Weekly revenue is $160k. Developers get $53333 of that, for $2667 each at $67/hr. Managers could get up to $10667 of that, for $5333 each at $133/hr. The HR person can get up to $2667, for $67/hr. The cleaner gets up to $667, for $17/hr. But the managers are operating at capacity, one more developer would require one more manager, for 3 managers over 21 developers, maxing out at $93/hr. So you target that instead. The same speculative calculation for the HR person means that one more developer adds one more manager, which puts the only HR employee at their workload limit of 26 (21+3+1+1). One more developer would require one more HR (22+3+2+1), which maxes out at $37/hr, so that's what you pay the one you have. You wouldn't need another cleaner until 102 developers (102+13+5+2), which would be as much as $43/hr. You never see cleaners paid that much, though, because cleaners have more competition as less-skilled labor, and they never hit the maximum any given company could afford to pay them. So you end up with payroll of about $63k/week, leaving $97k/week to pay the building lease, utilities, depreciation, taxes, etc. with the remainder to the owners.