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 solution file in Visual Studio and build the project.
Start ArcMap.
Click the Customize menu, click Toolbars, and click Routing Sample to enable the Routing Sample toolbar.
Click the button on the Routing Sample toolbar to open the Routing Sample dialog box.
Browse to the location of a routing service file (.rs extension) and select it in the Routing Service field.
Browse to the location of an address locator file and select it in the Address Locator field.
Enter the address of the starting location for driving directions in the Start section and the address of the ending location in the Finish section.
In the Options section, specify the type of route, quickest or shortest, to be calculated. Specify the distance units and select the street type preference for routing using the slider bar; for example, moving the slider towards Use Local Roads causes the router to utilize non-highway roads as much as possible in the output driving directions.
Optional. Click the Restrictions button to open the Restrictions dialog box. If the data referenced by the routing service file specified in step 5 contains restriction attributes, this dialog box will be populated with the available restriction parameters. Set the restrictions in this dialog box as desired.
Optional. If a point feature class containing barrier features is available, browse to it in the Barriers Table field.
Click the Find Route button to generate a list of driving directions and display a route graphic in ArcMap.
Click the Show Directions button to open the Driving Directions dialog box, which contains the list of driving directions.