When is a transponder required below class B airspace?
Short answer: mode C is required unless the aircraft was originally certificated without an electrical system; but ATC can always authorize you to operate within the veil anyway.

Your question isn't exactly about class B airspace itself, it's about the mode C veil; those are separate things although they do go together. (Note that from 1 Jan 2020, you'll require ADS-B out to operate within the veil so the name will be a bit outdated).

The AIM section 3-2-3 has a good explanation of the transponder requirements but the regulations are more precise and complete. They're in 14 CFR 91.215(b)(2) (and see 91.225(d)(2) for the ADS-B ones) and they apply within the veil, not within class B:


  All aircraft. In all airspace within 30 nautical miles of an airport
  listed in appendix D, section 1 of this part from the surface upward
  to 10,000 feet MSL;


That means that the shape of the class B airspace has nothing to do with the shape of the veil, which is always a cylinder 30nm across and 10,000ft high. 

As for operating without an electrical system, that's covered in the same section. If the aircraft has no electrical system by design then you can operate within the veil but clear of class B:


  any aircraft which was not originally certificated with an
  engine-driven electrical system or which has not subsequently been
  certified with such a system installed, balloon or glider may conduct
  operations in the airspace within 30 nautical miles of an airport
  listed in appendix D, section 1 of this part provided such operations
  are conducted—
  
  (i) Outside any Class A, Class B, or Class C airspace area; and
  
  (ii) Below the altitude of the ceiling of a Class B or Class C
  airspace area designated for an airport or 10,000 feet MSL, whichever
  is lower; and


If the aircraft has an electrical system but it isn't working (i.e. you're taking the aircraft for maintenance) then you can request authorization from ATC to operate within the veil:


  (d) ATC authorized deviations. Requests for ATC authorized deviations
  must be made to the ATC facility having jurisdiction over the
  concerned airspace within the time periods specified as follows:
  
  [...]
  
  (2) For operation of an aircraft with an inoperative transponder to
  the airport of ultimate destination, including any intermediate stops,
  or to proceed to a place where suitable repairs can be made or both,
  the request may be made at any time.


You can also request ATC authorization if you don't have a transponder, or if it doesn't have mode C. But if you don't have a transponder, you need to request authorization at least one hour in advance, you can't request it "at any time" as you can in other cases (see 91.215(d)(3)).