software isn't just about the manufacturing cost at the end. It's also about the development cost.
That's true, but I don't know that the development cost of Photoshop is any more than the development cost of a lens.
How much programming goes into something like Photoshop? Or an even more extreme case, an operating system?
A lot. Really, really a lot. But in the end, the programmers are paid for their time, not by the line. I wonder how many people work on the Photoshop team at Adobe compared to how many work R&D for Canon. Canon releases new cameras and lenses every year, and Adobe releases new versions of Photoshop every year or two. So we should be able to approximately determine the number of man-hours that goes into development of each product.
And it is not entirely true you couldn't make a near-zero cost lens.
Perhaps you could make the raw materials that go into a lens extremely cheap, but the marginal cost of manufacturing the lens should include the cost of the manufacturing facilities and wages of the workers in addition to the cost of raw materials.