Are you placing a camera over the spaces or like a security camera which can scan larger areas?
Language: You could write this in C++ or C#. Up to you.
Multiple Cameras Over Large Scan Area Method
Here is a research paper using large scan areas. I am not confident that this method will work well in real-time based on occlusions and difficulties with correlating multiple cameras over a parking lot. If the parking lot is small, this is easy, but it gets more difficult with having to merge multiple areas to get an overall count.
Camera over each lane method:
My recommendation is to use a simple D-Link Internet Camera (DCS-3220 or DCS-3220G) with Motion Detection. They are not expensive. You will have to write a server component that will be able to receive the images. The D-Link Internet Cameras have the capability to FTP the images to a pre-defined directory. If using multiple cameras, have them all point to the same FTP and just a different directory such as C:\Garage\Space1, C:\Garage\Space2, etc. When motion is detected in the image, you can have it FTP the image to your server. Since you did not say you are using loop detection or something else, you'll have to use special algorithms to determine if a car, motorcycle, or truck is actually in the space.
** With traffic loop method ** :
If you ARE using loop detection, then this makes it much easier because then you can determine if a big hunk of metal is in the "lane" (i.e space). The D-Link Internet Cameras have Digital I/O so you can 'trigger' the camera to take the picture and send it to your server. I have done this in the past for many applications and it works great. You will need to either have a separate controller to handle the loop detection or iterate over all of your 'space' directories to see if an image is in there. The latter method is slower because you could have a garage with over a 1,000 spaces and the hard drive would be cranking!
** No traffic loop method: **
Next, your server component will have to determine if a car is actually in the space. This is the hard part! You will need to go to the Computer Vision Homepage and find sample projects and research papers which have already covered this in detail. This is the best I can give you.
Having said all that, cameras over the spaces will not be cheap!