Well, they don't actually produce the hard drives and the memory, if that's what you mean. This is no different from Dell or HP, who are also considered hardware companies.
As a matter of fact, 'hardware company' is not the right term to describe Apple or Dell. I'm not sure of the correct term for them, but a hardware manufacturer would be a company like nVIDIA or VIA.
So, in that sense, Apple is not a hardware company, but still relies on the sales of its computers, rather than on their operating system.