Per computer? They'll be netting a much higher gross. But overall project gross margins tend to be around 30-40% yes.
The physical cost of manufacture, let's say parts, is going to be around $600-900, then add labour costs and shipping/sales, even it up to $1000 or 50% gross. Those funds will then go to paying for things like R&D, marketing/advertising, and support (With a percentage left aside for potential warranty repairs and customer support). Which could be 25% gross, so the cost is $1500. Then they'll set aside further funds for future re-investment, such as developing the next iteration or investing in manufacturing to reduce costs etc. So that'll be another 12.5%. So in the end they'll net around ~10% in net profit. Which will go towards bonuses, shareholders or company investment.
If you just look at the cost of the machine it's easy to think it's this huge profit they're making. But you need to look at the overall cost. Say it cost $1 million to bring to the stores, and each unit cost $2000, and they want to net 10%. This means they need to sell 550 units to achieve this.
So scale this up (Speculative on total Mac sales, real world data is out there if you want). Apple sold year on year around 4.1 million Macs (Average price around $1500) and the gross revenue is around $6.1bn. Minus the 30% leaves around $4.2bn, so that's the cost of bringing it to store. Meaning $1.8bn gross, and doing all the maths leaves around $180 million in pure profit.
Now that may seem like a lot (And it's all speculative again, I'm working from rough numbers because this is a forum and I can only be bothered to do so much), but it all has to be looked at as a percentage. Thankfully Apple employ people far better with numbers and business than myself to ensure that healthy profit margin, but that's essentially what you're looking at here.