score:9
The rules are complex and depend a lot on origin, destination, transfers, operating airlines, class, sub-class/fare and more.
But here's a quick breakdown, with info from Emirates' checked baggage page, for the simple case (single flight, sold and operated by Emirates).
If your flight is covered by the "Weight Concept":
You can have a total of 20, 25, 30, 35, 40, or 50 kg depending on the class or travel and your origin/destination.
This is the total for all your luggage. You can have as many pieces of luggage as you want, but the total must be within the limit.
Each piece of luggage cannot weigh more than 32 kg.
So even if you have an allowance of 40 kg, you cannot have one 40 kg bag. You can have two 20 kg bags, or one 30 kg bag and another of 10 kg, for instance.
There is also a limit on the size of each piece of luggage: length + width + height < 300 cm.
If your flight is covered by the "Piece Concept":
Depending on your fare, you may have one piece up to 23 kg, two pieces up to 23 kg or two pieces up to 32 kg.
There is no total limit lower than the sum of the limit per piece. So if you have an allowance of 2 x 32 kg, you are allowed a total of 64 kg.
You cannot have more pieces of luggage than the number stated. So if you have an allowance of 2 x 23 kg (a total of 46 kg), you cannot have 3 bags of 20, 10 and 10 kg for instance.
Whether you can "pool" the total allowance is unclear. For instance, if you have an allowance of 2 x 23 kg, I'm not quite sure you can have a single 30 kg bag instead. It used to be the case that airlines allowed it, nowadays it's often, the case they don't. You'd have to ask them about that.
Note that in this case the normal limit on length + width + height is 150 cm, anything between 150 and 300 cm will result in oversize baggage fees.
You can usually pool allowances of all passengers on a single ticket/booking, with the same itinerary and final destination. So if you have two people which both have 2 x 23 kg under the piece concept, you could have 3 bags for one person and a single one for the other.
You indicate that you have a 40 kg allowance, which points towards the weight concept. If it is the case, you can indeed go up to 40 kg total, but as pointed out above, not in a single piece of luggage: each must be 32 kg max.
You also indicate that your travel companion has a 2 x 23 kg allowance, which points towards the piece concept. That makes me think that the two people travel on different tickets/bookings, possibly with different itineraries. You probably won't be able to pool those.
Note that you an always have more luggage than the allowance: you'll just have to pay more for it ("excess baggage fees"). This can be very expensive.
On the other hand, you won't be able to check luggage that is heavier than the 32 kg limit per piece or larger than the 300 cm total length limit. Those need to be booked as freight, and the procedure is very different.
If you have connections, or one or more of the flights are operated by other carriers, then the rules can be different.