I wrote a small addon that queries mana and time with UnitPower() and GetTime() API functions to generate a timeline for the pet's mana. I have a value for mana each 0.1s (approximately). I emptied the pet's manapool and recorded from there until its mana was full again.
I tested mana regeneration of imp, felhunter, succubus and felguard in this way. The three melee pets seem to use the same formula, the imp uses a different one. All pets use the five second rule mechanic; I derived different formulas for the mana regeneration in the first five seconds after a cast and for the time after five seconds. There is no simple relationship between the regeneration in and out of the 5SR, the regeneration out of the 5SR depends on the pet's spirit, the in 5SR regeneration does not.
I first tested the scaling of mana regeneration with the pet's intellect by swapping out different items. I found that their mana regeneration increases linearly with their intellect. Since pets don't benefit from their master's spirit, I had to use spirit increasing buffs to test spirit scaling. This was the point where it started to get complicated, because some buffs were taken into account for computing mana regeneration but others were not.
I will show the intellect sclaing with different buffs on the pets. If you're only interested in the results, scroll down to the bottom. MPS = mana gained per second. Uncertainties are in the last digit for all values.
Imp, in 5SR
No buffs: MPS = 0.2001 * int - 73.7 = 0.2001 * (int - 368)
3/3 Fel Vitality: MPS = 0.1753 * int - 74.4 = 0.1753 * (int - 424)
Scroll of Spirit VII: MPS = 0.2002 * int - 73.9 = 0.2002 * (int - 369)
Scroll of Spirit VIII: MPS = 0.2006 * int - 74.0 = 0.2006 * (int - 369)
Blessing of Kings: MPS = 0.1800 * int - 72.5 = 0.1800 * (int - 403)
Mark of the Wild: MPS = 0.2002 * int - 84.15 = 0.2002 * (int - 420)
Divine Spirit: MPS = 0.2010 * int - 74.2 = 0.2010 * (int - 369)
MotW+Divine Spirit: MPS = 0.1997 * int - 83.7 = 0.1997 * (int - 419)
The increase per intellect is more or less constant except for fel vitality and BoK. 369 intellect is the base value for the imp, so we most likely have 0.2*(int-369). Let's take a closer look at Fel Vitality: 0.1753 ~ 0.2/1.15 and 424 ~ 369*1.15 - the talent seems to be neglected in the calculation. BoK and MotW too: 0.1800 ~ 0.2/1.1, 403 ~ 369*1.1; 420/419 ~ 369+51 (improved MotW).
Succubus, in 5SR
No buffs: MPS = 0.0676 * int - 10.3 = 0.0676 * (int - 152)
3/3 Fel Vitality: MPS = 0.0583 * int - 10.10 = 0.0583 * (int - 173)
Arcane Intellect: MPS = 0.06649 * int - 13.89 = 0.06649 * (int - 209)
Scroll of Spirit VII: MPS = 0.0667 * int - 10.0 = 0.0667 * (int - 150)
Scroll of Spirit VIII: MPS = 0.0669 * int - 10.04 = 0.0669 * (int - 150)
Divine Spirit: MPS = 0.06672 * int - 10.01 = 0.06672 * (int - 150)
Base intellect for the succubus is 150. Arcane Intellect is not taken into account (209 ~ 150+60), neither is Fel Vitality (0.0583 ~ 0.0667/1.15, 173 ~ 150*1.15). MPS per int may be 1/15.
Felhunter, in 5SR
No buffs: MPS = 0.0667 * int - 9.97 = 0.0667 * (int - 150)
3/3 Fel Vitality: MPS = 0.0581 * int - 10.00 = 0.0581 * (int - 172)
Scroll of Spirit VII: MPS = 0.0669 * int - 10.08 = 0.0669 * (int - 151)
Scroll of Spirit VIII: MPS = 0.0667 * int - 9.97 = 0.0667 * (int - 149)
Fel intelligence: MPS = 0.0667 * int - 13.17 = 0.0667 * (int - 197)
Base intellect is again 150. Fel Vitality as above. At least the intellect portion of fel intelligence is neglected (197 ~ 150+48). Looks like the same formula used for succubus.
Felguard, in 5SR
No buffs: MPS = 0.0669 * int - 10.04 = 0.0669 * (int - 150)
3/3 Fel Vitality: MPS = 0.0582 * int - 10.00 = 0.0582 * (int - 172)
Scroll of Spirit VII: MPS = 0.0668 * int - 10.02 = 0.0668 * (int - 150)
Scroll of Spirit VIII: MPS = 0.0667 * int - 9.98 = 0.0667 * (int - 150)
Base intellect is again 150. Looks like the same formula used for succubus and felhunter.
Imp, out of 5SR
No buffs: MPS = 0.2282 * int - 60.4 = 0.2282 * (int - 265)
3/3 Fel Vitality: MPS = 0.201 * int - 59.6 = 0.201 * (int - 297)
Scroll of Spirit VII: MPS = 0.2310 * int - 58.9 = 0.2310 * (int - 255)
Scroll of Spirit VIII: MPS = 0.2329 * int - 58.0 = 0.2329 * (int - 249)
Blessing of Kings: MPS = 0.209 * int - 56.9 = 0.209 * (int - 272)
Mark of the Wild: MPS = 0.2294 * int - 67.4 = 0.2294 * (int - 294)
Divine Spirit: MPS = 0.2337 * int - 57.3 = 0.2337 * (int - 245)
MotW+Divine Spirit: MPS = 0.235 * int - 64.2 = 0.235 * (int - 273)
Fel Vitality, BoK and MotW look strange again. Both parameters seem to be influenced by spirit. The spirit from BoK and MotW may be taken into account, the MPS per intellect is slightly higher for MotW+Divine Spirit than for just Divine Spirit.
Succubus, out of 5SR
No buffs: MPS = 0.088 * int - 4.6 = 0.088 * (int - 52)
3/3 Fel Vitality: MPS = 0.0755 * int - 3.0 = 0.0755 * (int - 40)
Arcane Intellect: MPS = 0.0858 * int - 7.7 = 0.0858 * (int - 90)
Scroll of Spirit VII: MPS = 0.092 * int - 3.2 = 0.092 * (int - 35)
Scroll of Spirit VIII: MPS = 0.0940 * int - 2.5 = 0.0940 * (int - 26)
Divine Spirit: MPS = 0.096 * int - 2.1 = 0.096 * (int - 22)
Fel Vitality and Arcane intellect look strange. Dependence on spirit.
Felhunter, out of 5SR
No buffs: MPS = 0.0877 * int - 4.2 = 0.0877 * (int - 48)
3/3 Fel Fitality: MPS = 0.0779 * int - 3.9 = 0.0779 * (int - 50)
Scroll of Spirit VII: MPS = 0.092 * int - 3.2 = 0.092 * (int - 35)
Scroll of Spirit VIII: MPS = 0.0940 * int - 2.5 = 0.0940 * (int - 26)
Fel Intelligence: MPS = 0.0911 * int - 4.8 = 0.0911 * (int - 52)
Values with fel intelligence are not what they should be. As MPS per int is higher than without buffs, the spirit increase is probably used in the formula. Fel Vitality looks strange again.
Felgueard, out of 5SR
No buffs: MPS = 0.0877 * int - 4.3 = 0.0877 * (int - 49)
3/3 Fel Vitality: MPS = 0.071 * int - 1.2 = 0.071 * (int - 17)
Scroll of Spirit VII: MPS = 0.092 * int - 3.2 = 0.092 * (int - 35)
Scroll of Spirit VIII: MPS = 0.0939 * int - 2.5 = 0.0939 * (int - 26)
Fel Vitality. Rest looks like the formula used for succubus and felhunter.
I think this is enough to say, that mana regeneration out of the five second rule depends on spirit. When looking at the values for the regeneration out of the 5SR (leaving out those from neglected buffs), I see a pretty much perfect plane, so thats what I'm going to assume. There seems to be some curvature, but the deviation from the plane is very small (< 1 MPS for the range I tested). I wasn't able to recognize any parameters that can be derived from the pet's stats in this case.
To summarize:
Mana regeneration in the 5SR:
MPS = 0.2 * (int - 369) for imps and
MPS = 1/15 * (int - 150) for melee pets
(where "int" is the pet's intellect without Fel Vitality, Blessing of Kings, Mark of the Wild, Fel Intelligence and Arcane Intellect).
Mana regeneration out of the 5SR:
MPS = 0.2308 * int + 0.070 * spi - 87.3 for imps and
MPS = 0.0911 * int + 0.053 * spi - 16.3 for melee pets
((where "int" is the pet's intellect without Fel Vitality, Blessing of Kings, Mark of the Wild, Fel Intelligence and Arcane Intellect and "spi" is its spirit including all buffs).
Note: The above formula doesn't really explain the values I got with Fel Vitality, Arcane Intellect, Fel Intelligence, Mark of the Wild or Blessing of Kings. It also doesn't explain them if you only count the increase of spirit and neglect the increase of intellect. The difference in MPS isn't that large though.