You indicate two separate problems: how to move from code to a diagram and how to use it as a guide for implementing the system. If you are drawing a diagram of existing code, I do not think the second question is applicable.
If you are developing new code, then a component diagram can be 1) a useful abstraction for understanding the important parts of the code, minus all the distractions and 2) a good way to communicate with others.
If you look at existing code, then the existing component diagram (or one of several other UML artifacts) can serve as a guide for the code, which especially helps in maintenance: it is easier to locate errors, the main responsibilities of the class, etc.
If there is no diagram, then doing this by reading the code is a good way to get to know each other. I did this in a number of cases when inheriting a complex code base. As a result, I have a couple of pages of application diagrams and databases that tell me at first glance interesting things about its main components. At any time, I will be well acquainted with some areas, and not with others, depending on what I'm working on. Charts are a good reminder of how to use the various parts of the application. And they are useful in bringing others to the team; they understand the code much faster after an hour and a half walk on the chart.
To work with existing code, you will need to read it, identify the main classes used and go back to understand the dependencies and interfaces, method signatures and data structures that they use to work together. If this is a database-enabled application, it may be useful to see a description of the database, as it should reflect the main problems of the application.
This helps to have some use cases to guide the investigation, as in event-driven applications, you need to understand what the user does to track the code. If there are no existing use cases, start by writing some simple high-level ones. Then go through the code for the used case and identify the main objects used. We hope you find the main classes in the program to determine the main use cases you use. For example, if the application is an e-commerce web application with an administrative user interface, then you will identify a number of end-user and administrative-user use cases and should expect to see some classes specific to each of these families, as well as general and utility classes. used everywhere.
Stay at a high level, avoid the temptation to consider every thing that you come across.
As Pascal said, Scott Ambler is an excellent resource for practical UML knowledge and has guild lines that you can use as little or as much as you like. In particular, see Introduction to UML 2 Component Diagrams . Hover, he writes a lot more for people developing new code than those who document existing code, so you need to adapt some of what he discusses.