Shimano rear mechs, shifters and cassettes are all compatible, except for 10 speed MTB rear mechs which need 10 speed MTB shifters.
But avoid anything called Dyna-Sys and you'll be fine. I'm running 10 speed 105 STIs with a 10 speed SRAM 11-32 cassette, 105 mechs and a 9 speed Sora compact chainset. No problems at all.