http://cayotic.com/b16a_camshaft.jpg
These are camshafts. There are three cam lobes, which are the triangle type lumps in groups of three along the shaft. The thinner, shortest one is the primary lobe. The wider, medium high lobe is the secondary. The middle lobe (widest and biggest) is the VTEC lobe.
Now, when your engine is running, these shafts are spinning. In this picture, you can see the engine head. Its off of a b18c1 (gs-r)
http://cayotic.com/diagram.jpg
you can plainly see from left to right on the first group of cam lobes, Primary, VTEC, and Secondary(circled in red). The valves are under the two little flathead screws that are near the walls (circled in yellow) Under each cam lobe, you can see three things that resemble blocks. Those are the rocker arms (circled in green)
http://cayotic.com/coveroff.jpg
The way the engine works is that the camshaft spins, and the lobes hit the rocker arms. the valves are connected to the rocker arms. so when the lobe hits, rocker arm is pushed down, and the other end that is attached to the valve is raised, therefore raising the valve. In this case the closer camshaft is the exhaust camshaft, so therefore the exhaust valves would be opened by the rocker arms.
How does vtec work then? You can see that there is no valve under the VTEC rocker arm for the rocker arm to act upon. So when you are not in VTEC, the primary and secondary lobes are hitting the rocker arms, and the valves are working. But the VTEC rocker arm is just moving along, being pushed down by the VTEC lobe, but its not acting on anything.
For VTEC to kick in, you need 2 things. 1) Engine must be in normal operating temperature - read: If you just turned on the car for the first time that day, vtec is not going to kick in. 2) Oil pressure must be up to par - read: if your oil pump is malfunctioning, or you have a low oil level, VTEC will not engage.
Now, on this picture, the VTEC solenoid is circled below.
http://cayotic.com/vtecsolenoid.jpg
What that solenoid does is when oil and temp is optimal, it sends a pin thru each set of rocker arms. U can't see it in the pictures, but a pin slides thru a hole in each rocker arm, effectively linking all the rocker arms to move in unison.