The calculation is straightforward. The capacitor size is simply a question of how much voltage drop you can tolerate over the duration of the pulse. The average current from the battery is a function of the duty cycle.
ΔV = I × Δt / C
Solving for C gives:
C = I × Δt / ΔV
Let's assume you can allow ΔV = 0.1V. For your first example, this works out to:
C = 25 mA × 25 ms / 0.1 V = 6.25 mF
The average current draw is 25 mA * 25 ms / 2.5 s = 0.25 mA.
For the second example, the numbers work out to:
C = 50 mA × 100 ms / 0.1 V = 50 mF
Average current = 50 mA * 100 ms / 1.0 s = 5 mA.
Technically For USB, you should typically draw no more than 100mA, unless you're enumerating the device and specifically asking to draw higher current. According to the spec, you can enumerate yourself and request up to 500mA in USB 2.0 spec. However, these limitations are rarely enforced physically, meaning that usually you will be able to draw until some circuitry in the PC limits you. So, in general, less than 500mA is safe.
The voltage regulator you chose is an older regulator that has very little short circuit protection, reverse voltage protection, overheating protection, etc. I suggest you select a more modern part that can do what you need and includes all of these things. Note that the microcontroller will likely need direct connection to the USB VCC.
Selecting the 3.3V regulator, you need to take into account primarily output current and dissipation (Aside from the obvious fixed voltage output and a Vin that includes 5V), although for 500mA it's not that big of a concern.
Your circuit needs a fuse as well. Select a fast acting fuse.
Also, I didn't see the typical ferrite bead and decoupling capacitors that are usually added. Your microcontroller likely needs direct connection to 5V bus to be able to operate with USB, so check the reference circuit for the part you're using.
Finally, if you're that worried about your Mac at first, power the board using some AC to 5V converter like the ones used for charging phones. Measure the current and make sure that the it's ok. Also, always measure whether there's a short circuit between the USB Bus VCC and GND before connecting it to anything.
The ARM processor you're using will be much less than the limit. Look at its datasheet on page 1013, it tells you that at 80MHz fully running it is 90mA. Add the extra stuff and GPIOs to it and USB is plenty.
Best Answer
According to this spec, the maximum current draw is 80mA.