Oogenesis
The process in which the oocyte is produced is called oogenesis and arises from the pole cells that migrated to the posterior side of the egg during nuclear mitosis.
In the ovarioles, at the most distal end to the reproductive tract, is what is know as the "germarium", which gives rise to stem cells, oocyte and the cells that give nutrients to the oocyte.
The process is illustrated below.

A germ line stem cell in the germarium divides to form another stem cell and a cell known
as a cystoblast.

Cystoblast divides until there are 16 cells, 1 of which becomes the oocyte and 15 become nurse cells.

Follicle cells from the ovarioles surround the oocyte and are important for future gene transcription. The oocyte at this stage is restricted to the first stage of meiosis and will re establish after ovulation when it moves down the reproductive tract to be fertilized.
Spermatogenesis
As above the future sperm arrises from the pole cells of the fertilised egg. The illustration below shows a simplified cartoon of the process in which a mature sperm arises.

hub cells in the testes are in a an area known as the stem cell niche. Stem cells must be attached to hub cells, via unpaired jak/stat pathway, to remain as stem cells. 1 stem cell divides to give rise to another stem cell and a gonealblast.

Gonealblast undergoes 4 divisions to produce 16 spermatocytes, which is called a spermatocyst.
2 somatic cells are recruited to help stabalise the cyst.

Sperm emerges from spermatocyte after further rounds of divison, resulting in a haploid sperm.
Drosophila produce sperm that is not in proportion to body size, with the avarage fruit fly being 2mm in length it is not unusual to find sperm that 50mm in length.