So this is an issue that has plagued me for a long time. Here's how to yank from vim to the system clipboard, on Ubuntu at least:
First of all, the typical vim installed from apt doesn't have the +clipboard feature, as of this writing. (To check, run vim --version and if you see "-clipboard" (and not "+clipboard"), then your version of vim was not compiled with clipboard support.) To get a version which does have support, run:
sudo apt-get install vim-gnome
dpkg should automatically handle symlinks and things to make vim.gnome your default vim now, but if it doesn't and you may want to alias vim to vim.gnome and view to vim.gnome -R, in order to make things more convenient.
Next, depending on your system one of "*yy or "+yy will yank into the register corresponding to the clipboard. Run these WIHOUT a colon in front. Should work in normal mode or visual mode. I recommend creating both a map and a vmap in your .vimrc from something like 'Y' (without squotes) to either "*yy or "+yy, whichever command works. E.g.:
map Y "+y
vmap Y "+y
This will allow you to do all the normal yanking operations to the clipboard simply by replacing all lowercase y's in the command to uppercase Y's. For example, to yank the next 5 lines to the clipboard in normal mode: Y5Y.
One last thing -- yanking to the system clipboard also seems to yank to the normal vim buffer, so if you wanted to, you could remap lowercase 'y' altogether. Note that this modification will overwrite your clipboard even when doing normal yanking, which is something that you may want to avoid in certain circumstances.
That's it!