Well, the basic idea is to take some signal in a buffer and play back bits (grains) of it, especially small bits, typically around 50::ms (give or take a few octaves). The 50::ms comes from that being the threshold where human hearing will still detect pitch (20Hz) You can play back just a few grains every once in a while, resulting in a rhythmical pattern or lots&lots of them for noisy textures. A simple intro is found here as well;
http://en.wikipedia.org/wiki/Granular_synthesis
There are some examples in the LiSa examples ( /examples/special/ ), but those might not be general enough for you.