Sure, I'd be happy to help. First you'll need some materials: one door and three mechanisims. The door can be made either of wood, metal, or stone at the carpenter's, metalsmith's, or stoneworker's workshops, respectivly. The mechanisims are made of stone at the mechanic's workshop. It will also require at least one dwarf with the following professions enabled: furniture hauling and mechanics.
The next step is to place the gate and the lever. Build your gate using the door, and build a lever using one of the mechanisims. The keys to press for the door are: (b)uild, (d)oor, move the cursor to the place you want the door, then (enter). For the lever it's: (b)uild, (shift)+(t)raps, (l)ever, place the cursor, press (enter).
The final step is linking the lever to the door. Be warned that once you link the door up, it can only be opened and closed by pulling the lever. Select the newly built lever by pressing (q) and moving the cursor over it. Press (d) to select 'link with door' from the lever's menu. A list of available doors with appear from which to select the one to link to. The list is in order of when they were built, so just press the (numpad -) key to pop to the bottom of the list, if the door you want to link was the last one built. Once the door's selected, a list of available mechanisims will be shown; select two of them.
An available dwarf with the mechanics profession will pick up the linking job, eventually. And that's it, you now have a fully functional lever controlled gate. Enjoy.