See
How to use ArcGIS samples
for help on compiling, setting up the debugger, and running the sample.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders.
However, you will need to update the sample to point to the location of the data once you have extracted all the files.
Open the .sln file in Visual Studio and compile it.
Start ArcMap and make the Utility Network Analyst toolbar visible.
Add a geometric network to the map.
Using either the Edge Flag tool or the Junction Flag tool, add at least one flag to the geometric network.
Optionally, on the Utility Network Analyst toolbar, click Analysis and click Disabled Layers to disable layers. To set other analysis options, click Analysis and click Options.
In the Trace Task drop-down list, select the Custom Upstream Trace task.