Set texture sampler state in custom effect

This works for all shaders, just use the SamplerState like this:

SamplerState mySamplerState = new SamplerState()
{
   AddressU = TextureAddressMode.Wrap,
   AddressV = TextureAddressMode.Wrap,
   Filter = TextureFilter.LinearMipPoint
}

You can use e.g. SamplerComparisonState defined this way for your shadow maps etc.