Generally speaking, the walls, gates and towers of a castle are far too massive and solid for ordinary troops to knock down, but there are exceptions. Some exceedingly powerful models may be able to knock down castle walls, etc, due to their sheer brutality and awesome strength. Greater Daemons, Dragons and Giants, for example, are so big and powerful that they pose a serious threat to even a well-constructed fortress.
Models may make one attack (and one attack only, regardless of the number of attacks they normally have) against a wall, tower or gateway in each Close Combat phase. Not surprisingly, any part of the castle will be hit automatically. The model must, of course, be in base contact with its target. Note that chariots may not attack castle walls, towers or gates, as they would undoubtedly be smashed to smithereens. The same also applies to Skaven Doomwheels and Screaming Bells.
Determine damage normally, ie, roll the number of hits/wounds the attack causes (normally this will be 1), consult the appropriate Damage chart, and apply the given result. Any bonuses from magic weapons apply.
In general, close combat attacks are not powerful enough to tear down walls or shake towers, but they are useful for breaking down gates and attacking structures already weakened by earlier bombardments.