As a device moves from development into manufacturing, costs move from R&D expense to inventory, then to cost of goods sold. Here's where they go at each stage.

When the manufacturing process is set and you're building units to sell. From that point, materials, labor, and overhead for those units go to inventory, and become cost of goods sold as the units sell.
It depends on why you're building them. If you're still testing whether and how the process works, the costs are usually R&D. If the process is set and the units will be sold, they're inventory. Decide the rule before the first pilot build.
No. Work after commercial production begins doesn't qualify. Development on a next version or a new product can still count.