Fortunately, there are public companies that make bikes (i.e. Cannondale) and publish their gross margins. Obviously, they don't break it down in detail but it gives you a reasonable idea of the range of margins you can expect. As it turns out the margins are reasonable (40% as I recall) and in line with other competitive businesses.
Bottom line: No large bike manufacturers are buying bikes for $800 and selling them for $5000.