The way I do it is position my units a little further behind cover, so that they shoot the enemy when they try to climb over those walls. I also always have some grenadiers to smoke out any enemy units trying to hide behind those walls :)

It works perfectly, as the eney is temporarily slowed when they climb over walls, I get at least 6 volleys (2 times all three ranks) before they return fire. I get at least 2 volleys if that is a cavalry unit comming.

All on VH/H