Sorry for not being able to provide you with a satisfying answer.
I'll give you an example of some code that will (probably, untested) spawn some ore. You could call it when using an item (for testing purposes, of course).
Code:
public void GenOre()
{
int lx = 200;
int hx = Main.maxTilesX - 200;
int ly = (int)Main.worldSurface;
int hy = Main.maxTilesY - 200;
int x = WorldGen.genRand.Next(lx, hx);
int y = WorldGen.genRand.Next(ly, hy);
int minSpread = 2;
int maxSpread = 8;
int minFreq = 6;
int maxFreq = 8;
int s = WorldGen.genRand.Next(minSpread, maxSpread + 1);
int f = WorldGen.genRand.Next(minFreq, maxFreq + 1);
WorldGen.OreRunner(x, y, s, f, (ushort)mod.TileType("YourOre"));
}
Like stated before, this is untested, so it might not work the way it's supposed to work (and I'm afraid I'm currently not in a setting to test it myself).
I hope it works, though (or that you can build from it at least).