The U.S. B-2 bomber takes a lot of heat for its high price. The 21 that were built ended up costing $2.1 billion each. About half of that was development expense. Actual construction costs for each of those aircraft was about $933 million each. Still pretty high, mainly because a lot of special machinery and factories had to be built to manufacture the many custom components. The air force likes to point out that if the original (1986) plan had been followed, each B-2 would have cost $438 million each. But then the entire program would have cost $58.2 billion, versus $44.3 billion for the 21 plane program (which included $10 billion more R&D expense).
New technology gives a weapon, especially an aircraft, an edge in combat. But since World War II, most military technology has been developed in peacetime conditions. This means it is more than twice as expensive, as there is no wartime urgency to overcome bureaucratic inertia (and emphasis on covering your ass, which is very time consuming and expensive) and hesitation (because you don't have a war going on to settle disputes over what will work best). Developing this technology takes longer in peacetime, which also raises the cost, and fewer units of a new weapon are produced (driving up the amount of development cost each weapon will have to carry.) If several hundred B-2s were produced under wartime conditions, each aircraft would have probably cost $200 million each, or less. In other words, a tenth of what it actually cost.