As anyone who has seen Lucky Star will remember, most of the references to other anime and manga are censored. The most obvious examples of this are references to Gundam or Sgt. Frog (both of which are notably Sunrise shows). Presumably this is done to avoid KyoAni getting sued. This also explains why references to Haruhi and Full Metal Panic weren't censored (as far as I remember). Interestingly these instances of censorship probably could have been removed in the English release since it was licensed by Bandai, but I don't know if they actually were, so this question might only apply to the Japanese version.
However, there are still a few cases of references which weren't censored despite no obvious connection between the Lucky Star team and the source. The one that immediately comes to mind is To Heart, which is referenced several times. To Heart is associated with VN studio Leaf as well as animation studios Oriental Light and Magic and AIC, neither of which have anything to do with Lucky Star (KyoAni and Kadokawa). I can't find any connections between them, but of course that could be oversight on my part, and I didn't check all of the individual staff members.
Is there some connection that I missed? Barring that, what sort of policy would a studio typically use for references like this? Would they try to obtain permission for all of the references, or just bleep the ones that seem risky to them?