Shift a signal by fraction of a sample
There's a good overview article which appeared in 1996 in the IEEE Signal Processing Magazine: Splitting the unit delay: tools for fractional delay filter design. The nice thing about it is that there's also a set of related Matlab files available. These routines will allow you to design such a system.

As for shifting by an integer number of samples, what you did is obviously correct.